struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr68376-2.c
blobc89c78c721d4e3637c49cca195fe31fbc821388e
1 /*
2 pr68376-2.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* PR rtl-optimization/68376 */
9 int
10 f1 (int x)
12 return x < 0 ? ~x : x;
15 int
16 f2 (int x)
18 return x < 0 ? x : ~x;
21 int
22 f3 (int x)
24 return x <= 0 ? ~x : x;
27 int
28 f4 (int x)
30 return x <= 0 ? x : ~x;
33 int
34 f5 (int x)
36 return x >= 0 ? ~x : x;
39 int
40 f6 (int x)
42 return x >= 0 ? x : ~x;
45 int
46 f7 (int x)
48 return x > 0 ? ~x : x;
51 int
52 f8 (int x)
54 return x > 0 ? x : ~x;
57 void
58 testTortureExecute (void)
60 if (f1 (5) != 5 || f1 (-5) != 4 || f1 (0) != 0)
61 ASSERT (0);
62 if (f2 (5) != -6 || f2 (-5) != -5 || f2 (0) != -1)
63 ASSERT (0);
64 if (f3 (5) != 5 || f3 (-5) != 4 || f3 (0) != -1)
65 ASSERT (0);
66 if (f4 (5) != -6 || f4 (-5) != -5 || f4 (0) != 0)
67 ASSERT (0);
68 if (f5 (5) != -6 || f5 (-5) != -5 || f5 (0) != -1)
69 ASSERT (0);
70 if (f6 (5) != 5 || f6 (-5) != 4 || f6 (0) != 0)
71 ASSERT (0);
72 if (f7 (5) != -6 || f7 (-5) != -5 || f7 (0) != 0)
73 ASSERT (0);
74 if (f8 (5) != 5 || f8 (-5) != 4 || f8 (0) != -1)
75 ASSERT (0);
76 return;