From 180abc3db9ae3b4fc63cd65b15697e6ffcc8a657 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 17 Jul 2011 15:40:56 +0000 Subject: Vendor import of clang trunk r135360: http://llvm.org/svn/llvm-project/cfe/trunk@135360 --- test/Sema/compare.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/Sema/compare.c') diff --git a/test/Sema/compare.c b/test/Sema/compare.c index 5221b172a602..cd973d4885c7 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)); +} -- cgit v1.2.3