]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/pr90248.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pr90248.c
CommitLineData
36fe1cdc
JJ
1/* PR tree-optimization/90248 */
2/* { dg-do run } */
3/* { dg-options "-Ofast" } */
4
5volatile float b1 = -1.f;
6volatile float b2 = 0.f;
7
8__attribute__((noipa)) float
9f1 (float x)
10{
11 return x > 0 ? 1.f : -1.f;
12}
13
14__attribute__((noipa)) float
15f2 (float x)
16{
17 return x >= 0 ? 1.f : -1.f;
18}
19
20__attribute__((noipa)) float
21f3 (float x)
22{
23 return x < 0 ? 1.f : -1.f;
24}
25
26__attribute__((noipa)) float
27f4 (float x)
28{
29 return x <= 0 ? 1.f : -1.f;
30}
31
32__attribute__((noipa)) float
33f5 (float x)
34{
35 return x > 0 ? -1.f : 1.f;
36}
37
38__attribute__((noipa)) float
39f6 (float x)
40{
41 return x >= 0 ? -1.f : 1.f;
42}
43
44__attribute__((noipa)) float
45f7 (float x)
46{
47 return x < 0 ? -1.f : 1.f;
48}
49
50__attribute__((noipa)) float
51f8 (float x)
52{
53 return x <= 0 ? -1.f : 1.f;
54}
55
56int
57main ()
58{
59 float a = 0.f;
60 float b = b1 * b2;
61 float c = 2.f;
62 float d = -2.f;
63 if (f1 (a) != -1.f || f1 (b) != -1.f || f1 (c) != 1.f || f1 (d) != -1.f
64 || f2 (a) != 1.f || f2 (b) != 1.f || f2 (c) != 1.f || f2 (d) != -1.f
65 || f3 (a) != -1.f || f3 (b) != -1.f || f3 (c) != -1.f || f3 (d) != 1.f
66 || f4 (a) != 1.f || f4 (b) != 1.f || f4 (c) != -1.f || f4 (d) != 1.f
67 || f5 (a) != 1.f || f5 (b) != 1.f || f5 (c) != -1.f || f5 (d) != 1.f
68 || f6 (a) != -1.f || f6 (b) != -1.f || f6 (c) != -1.f || f6 (d) != 1.f
69 || f7 (a) != 1.f || f7 (b) != 1.f || f7 (c) != 1.f || f7 (d) != -1.f
70 || f8 (a) != -1.f || f8 (b) != -1.f || f8 (c) != 1.f || f8 (d) != -1.f)
71 __builtin_abort ();
72 return 0;
73}