PR tree-optimization/81384 - built-in form of strnlen missing
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr61673.c
blobb3e243da5275ccc87e29e659ac6e486a4ecc8c8b
1 /* PR rtl-optimization/61673 */
3 char e;
5 __attribute__((noinline, noclone)) void
6 bar (char x)
8 if (x != 0x54 && x != (char) 0x87)
9 __builtin_abort ();
12 __attribute__((noinline, noclone)) void
13 foo (const char *x)
15 char d = x[0];
16 int c = d;
17 if ((c >= 0 && c <= 0x7f) == 0)
18 e = d;
19 bar (d);
22 __attribute__((noinline, noclone)) void
23 baz (const char *x)
25 char d = x[0];
26 int c = d;
27 if ((c >= 0 && c <= 0x7f) == 0)
28 e = d;
31 int
32 main ()
34 const char c[] = { 0x54, 0x87 };
35 e = 0x21;
36 foo (c);
37 if (e != 0x21)
38 __builtin_abort ();
39 foo (c + 1);
40 if (e != (char) 0x87)
41 __builtin_abort ();
42 e = 0x21;
43 baz (c);
44 if (e != 0x21)
45 __builtin_abort ();
46 baz (c + 1);
47 if (e != (char) 0x87)
48 __builtin_abort ();
49 return 0;