diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
commit | b3a51061b1b9c4add078237850649f7c9efb13ab (patch) | |
tree | 8b316eca843681b024034db1125707173b9adb4a /test/Sema/conditional-expr.c | |
parent | b6d5e15aae202f157c6cd63da8fa4b089e7b31e9 (diff) | |
download | FreeBSD-src-b3a51061b1b9c4add078237850649f7c9efb13ab.zip FreeBSD-src-b3a51061b1b9c4add078237850649f7c9efb13ab.tar.gz |
Update clang to r86140.
Diffstat (limited to 'test/Sema/conditional-expr.c')
-rw-r--r-- | test/Sema/conditional-expr.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Sema/conditional-expr.c b/test/Sema/conditional-expr.c index 1f0a9de..3bfeae5d 100644 --- a/test/Sema/conditional-expr.c +++ b/test/Sema/conditional-expr.c @@ -34,6 +34,25 @@ void foo() { typedef void *asdf; *(0 ? (asdf) 0 : &x) = 10; + + unsigned long test0 = 5; + test0 = test0 ? (long) test0 : test0; // expected-warning {{operands of ? are integers of different signs}} + test0 = test0 ? (int) test0 : test0; // expected-warning {{operands of ? are integers of different signs}} + test0 = test0 ? (short) test0 : test0; // expected-warning {{operands of ? are integers of different signs}} + test0 = test0 ? test0 : (long) test0; // expected-warning {{operands of ? are integers of different signs}} + test0 = test0 ? test0 : (int) test0; // expected-warning {{operands of ? are integers of different signs}} + test0 = test0 ? test0 : (short) test0; // expected-warning {{operands of ? are integers of different signs}} + test0 = test0 ? test0 : (long) 10; + test0 = test0 ? test0 : (int) 10; + test0 = test0 ? test0 : (short) 10; + test0 = test0 ? (long) 10 : test0; + test0 = test0 ? (int) 10 : test0; + test0 = test0 ? (short) 10 : test0; + + enum Enum { EVal }; + test0 = test0 ? EVal : test0; + test0 = test0 ? EVal : (int) test0; // okay: EVal is an int + test0 = test0 ? (unsigned) EVal : (int) test0; // expected-warning {{operands of ? are integers of different signs}} } int Postgresql() { |