Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gcc.dg / ubsan / c99-shift-3.c
blobebb4f660ea9c0448a6752e6d86776836a4629c04
1 /* { dg-do run } */
2 /* { dg-options "-fsanitize=shift-base -fno-sanitize=shift-exponent -w -std=c99" } */
4 int
5 main (void)
7 int a = -42;
8 int b = -43;
9 volatile int c = 129;
10 int d = 1;
11 a << 1;
12 b << c;
13 a << 1;
14 d <<= 31;
16 /* { dg-output "left shift of negative value -42\[^\n\r]*(\n|\r\n|\r)" } */
17 /* { dg-output "\[^\n\r]*left shift of negative value -42\[^\n\r]*(\n|\r\n|\r)" } */
18 /* { dg-output "\[^\n\r]*left shift of 1 by 31 places cannot be represented in type 'int'" } */