PR tree-optimization/81384 - built-in form of strnlen missing
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr81588.c
blobb8f84b3e18c42075205fe8aaaaf9777b3662ff44
1 /* PR tree-optimization/81588 */
3 __attribute__((noinline, noclone)) int
4 bar (int x)
6 __asm volatile ("" : : "g" (x) : "memory");
9 __attribute__((noinline, noclone)) int
10 foo (unsigned x, long long y)
12 if (y < 0)
13 return 0;
14 if (y < (long long) (4 * x))
16 bar (y);
17 return 1;
19 return 0;
22 int
23 main ()
25 volatile unsigned x = 10;
26 volatile long long y = -10000;
27 if (foo (x, y) != 0)
28 __builtin_abort ();
29 y = -1;
30 if (foo (x, y) != 0)
31 __builtin_abort ();
32 y = 0;
33 if (foo (x, y) != 1)
34 __builtin_abort ();
35 y = 39;
36 if (foo (x, y) != 1)
37 __builtin_abort ();
38 y = 40;
39 if (foo (x, y) != 0)
40 __builtin_abort ();
41 y = 10000;
42 if (foo (x, y) != 0)
43 __builtin_abort ();
44 return 0;