2014-04-15 Max Ostapenko <m.ostapenko@partner.samsung.com>
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / shift-2.c
blob426ec093706743fd14704a8fcb3663cbb4e28295
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\n|\r)" } */
20 /* { dg-output "\[^\n\r]*shift exponent -4 is negative\[^\n\r]*(\n|\r\n|\r)" } */
21 /* { dg-output "\[^\n\r]*shift exponent -5 is negative\[^\n\r]*(\n|\r\n|\r)" } */
22 /* { dg-output "\[^\n\r]*shift exponent -6 is negative\[^\n\r]*(\n|\r\n|\r)" } */
23 /* { dg-output "\[^\n\r]*shift exponent -11 is negative\[^\n\r]*" } */