warn-shift-negative.c 178 B

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