* c-c++-common/ubsan/align-7.c: Skip for -flto -fno-fat-lto-objects.
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / pr60613-1.c
blobf358e19da9b1d4d419d6565c9d6dac96714b1723
1 /* PR sanitizer/60613 */
2 /* { dg-do run } */
3 /* { dg-options "-fsanitize=undefined -fno-sanitize-recover=undefined" } */
5 long long y;
7 __attribute__((noinline, noclone)) long long
8 foo (long long x)
10 asm ("");
11 if (x >= 0 || x < -2040)
12 return 23;
13 x += 2040;
14 return x - y;
17 __attribute__((noinline, noclone)) long long
18 bar (long long x)
20 asm ("");
21 return 8LL - x;
24 int
25 main ()
27 y = 1;
28 if (foo (8 - 2040) != 8 - 1)
29 __builtin_abort ();
30 if (bar (1) != 8 - 1)
31 __builtin_abort ();
32 return 0;