summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/shift.c
diff options
context:
space:
mode:
authorRyan Flynn <pizza@parseerror.com>2009-08-08 19:18:23 +0000
committerRyan Flynn <pizza@parseerror.com>2009-08-08 19:18:23 +0000
commit2f08571e4d52d0d535532468cd3210fecb81de13 (patch)
tree8cf26d2117a7032a4fd950e551214dc92e655395 /clang/test/Sema/shift.c
parent16cf1967f5ef12efd0c7db302d87f6e7d9071bf9 (diff)
downloadbcm5719-llvm-2f08571e4d52d0d535532468cd3210fecb81de13.tar.gz
bcm5719-llvm-2f08571e4d52d0d535532468cd3210fecb81de13.zip
PR4700 - remove shift by 0 warning
llvm-svn: 78488
Diffstat (limited to 'clang/test/Sema/shift.c')
-rw-r--r--clang/test/Sema/shift.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/test/Sema/shift.c b/clang/test/Sema/shift.c
index 4c2b88a7f01..2516d1b8610 100644
--- a/clang/test/Sema/shift.c
+++ b/clang/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) };
+
OpenPOWER on IntegriCloud