PR tree-optimization/81384 - built-in form of strnlen missing
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr68376-2.c
blob963d441b53f5c16052e2fb6f03939df7ccdd5f04
1 /* PR rtl-optimization/68376 */
3 extern void abort (void);
5 __attribute__((noinline, noclone)) int
6 f1 (int x)
8 return x < 0 ? ~x : x;
11 __attribute__((noinline, noclone)) int
12 f2 (int x)
14 return x < 0 ? x : ~x;
17 __attribute__((noinline, noclone)) int
18 f3 (int x)
20 return x <= 0 ? ~x : x;
23 __attribute__((noinline, noclone)) int
24 f4 (int x)
26 return x <= 0 ? x : ~x;
29 __attribute__((noinline, noclone)) int
30 f5 (int x)
32 return x >= 0 ? ~x : x;
35 __attribute__((noinline, noclone)) int
36 f6 (int x)
38 return x >= 0 ? x : ~x;
41 __attribute__((noinline, noclone)) int
42 f7 (int x)
44 return x > 0 ? ~x : x;
47 __attribute__((noinline, noclone)) int
48 f8 (int x)
50 return x > 0 ? x : ~x;
53 int
54 main ()
56 if (f1 (5) != 5 || f1 (-5) != 4 || f1 (0) != 0)
57 abort ();
58 if (f2 (5) != -6 || f2 (-5) != -5 || f2 (0) != -1)
59 abort ();
60 if (f3 (5) != 5 || f3 (-5) != 4 || f3 (0) != -1)
61 abort ();
62 if (f4 (5) != -6 || f4 (-5) != -5 || f4 (0) != 0)
63 abort ();
64 if (f5 (5) != -6 || f5 (-5) != -5 || f5 (0) != -1)
65 abort ();
66 if (f6 (5) != 5 || f6 (-5) != 4 || f6 (0) != 0)
67 abort ();
68 if (f7 (5) != -6 || f7 (-5) != -5 || f7 (0) != 0)
69 abort ();
70 if (f8 (5) != 5 || f8 (-5) != 4 || f8 (0) != -1)
71 abort ();
72 return 0;