diff options
author | Ryan Flynn <pizza@parseerror.com> | 2009-08-08 19:18:23 +0000 |
---|---|---|
committer | Ryan Flynn <pizza@parseerror.com> | 2009-08-08 19:18:23 +0000 |
commit | 8045c7393bc83060f812d0f7b1221edbc767407c (patch) | |
tree | 08549650519022dd367971312f433d865c1f0c17 /test | |
parent | a860e755f1f9f071b6a6a2f96128a6a258f5c331 (diff) |
PR4700 - remove shift by 0 warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Sema/shift.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/Sema/shift.c b/test/Sema/shift.c index 4c2b88a7f0..2516d1b861 100644 --- a/test/Sema/shift.c +++ b/test/Sema/shift.c @@ -12,15 +12,15 @@ void test() { char c; c = 0 << 0; - c = 0 << 1; // expected-warning {{no effect}} + c = 0 << 1; c = 1 << 0; c = 1 << -0; c = 1 >> -0; c = 1 << -1; // expected-warning {{shift count is negative}} c = 1 >> -1; // expected-warning {{shift count is negative}} c = 1 << c; - c <<= 0; // expected-warning {{no effect}} - c >>= 0; // expected-warning {{no effect}} + c <<= 0; + c >>= 0; c <<= 1; c >>= 1; c <<= -1; // expected-warning {{shift count is negative}} @@ -33,3 +33,8 @@ void test() { c >>= CHAR_BIT+1; // expected-warning {{shift count >= width of type}} (void)((long)c << CHAR_BIT); } + +#define a 0 +#define ashift 8 +enum { b = (a << ashift) }; + |