Reverting merge from trunk
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / shift-2.c
blob68a7d136f43a09e22b4f49a99359076021fc3433
1 /* { dg-do run } */
2 /* { dg-options "-fsanitize=shift -w" } */
4 int
5 main (void)
7 int a = 1;
8 volatile int b = -5;
9 long long int c = -6;
11 a << -3;
12 1 << -4;
13 1 << b;
14 a << c;
15 a << (b + c);
17 return 0;
19 /* { dg-output "shift exponent -3 is negative(\n|\r\n|\r)" } */
20 /* { dg-output "\[^\n\r]*shift exponent -4 is negative(\n|\r\n|\r)" } */
21 /* { dg-output "\[^\n\r]*shift exponent -5 is negative(\n|\r\n|\r)" } */
22 /* { dg-output "\[^\n\r]*shift exponent -6 is negative(\n|\r\n|\r)" } */
23 /* { dg-output "\[^\n\r]*shift exponent -11 is negative(\n|\r\n|\r)" } */