llvm-project/clang/test/Sema/warn-shift-negative.c
Davide Italiano 346048a1fa Fix -Wshift-count-negative. It didn't work if the right hand side
of the shift wasn't a constant integer expression, now it (hopefully)
does.

PR:		22059
llvm-svn: 233320
2015-03-26 21:37:49 +00:00

7 lines
178 B
C

// RUN: %clang_cc1 -fsyntax-only -Wshift-count-negative -fblocks -verify %s
int f(int a) {
const int i = -1;
return a << i; // expected-warning{{shift count is negative}}
}