diff options
author | John McCall <rjmccall@apple.com> | 2011-06-24 23:30:52 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-06-24 23:30:52 +0000 |
commit | 88c1dfccf8c5d487408e3365c752ed24c867c7ce (patch) | |
tree | 042ee6ca7a67a8546bde9bd183e3b8c6ec874e2b /test/Sema/sign-conversion.c | |
parent | 4027f0973676920f28f1fe8676d7a06bf2e2755b (diff) |
Two more test cases which have been long uncommitted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/sign-conversion.c')
-rw-r--r-- | test/Sema/sign-conversion.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Sema/sign-conversion.c b/test/Sema/sign-conversion.c new file mode 100644 index 0000000000..4b1ee75421 --- /dev/null +++ b/test/Sema/sign-conversion.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wsign-conversion %s + +// PR9345: make a subgroup of -Wconversion for signedness changes + +void test(int x) { + unsigned t0 = x; // expected-warning {{implicit conversion changes signedness}} + unsigned t1 = (t0 == 5 ? x : 0); // expected-warning {{operand of ? changes signedness}} +} |