diff options
Diffstat (limited to 'test/Sema/compare.c')
-rw-r--r-- | test/Sema/compare.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/compare.c b/test/Sema/compare.c index 5221b17..cd973d4 100644 --- a/test/Sema/compare.c +++ b/test/Sema/compare.c @@ -312,3 +312,18 @@ int rdar8511238() { return 0; return 20; } + +// PR10336 +int test9(int sv, unsigned uv, long slv) { + return sv == (uv ^= slv); // expected-warning {{comparison of integers of different signs: 'int' and 'unsigned int'}} +} + +void test10(void) { + int si; + unsigned int ui; + long sl; + + _Bool b; + b = (si == (ui = sl)); // expected-warning {{comparison of integers of different signs: 'int' and 'unsigned int'}} + b = (si == (ui = sl&15)); +} |