2 /* { dg-do compile } */
3 /* { dg-options "-O -Wshift-negative-value" } */
4 /* { dg-additional-options "-std=c++11" { target c++ } } */
9 C
= -1 << 1, /* { dg-warning "left shift of negative value" } */
10 /* { dg-error "not an integer constant" "no constant" { target c++ } .-1 } */
11 /* { dg-error "left operand of shift expression" "shift" { target c++ } .-2 } */
20 /* Warn for LSHIFT_EXPR. */
27 r
+= m
<< x
; /* { dg-warning "left shift of negative value" } */
30 r
+= -1 << x
; /* { dg-warning "left shift of negative value" } */
38 /* Shouldn't warn for RSHIFT_EXPR. */