Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / builtins-51.c
blobfdfc9bec7f9dd60de4f8abf45e59ac57c4789f7e
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ffast-math" } */
4 extern double pow(double, double);
5 extern double fabs(double);
6 extern void abort(void);
8 double test2_1(double x)
10 return pow(x,2.0);
13 double test2_2(double x)
15 return pow(-x,2.0);
18 double test2_3(double x)
20 return pow(fabs(x),2.0);
23 double test3_1(double x)
25 return pow(x,3.0);
28 double test3_2(double x)
30 return pow(-x,3.0);
33 double test3_3(double x)
35 return pow(fabs(x),3.0);
38 double test6_1(double x)
40 return pow(x,6.0);
43 double test6_2(double x)
45 return pow(-x,6.0);
48 double test6_3(double x)
50 return pow(fabs(x),6.0);
54 int main()
56 if (test2_1(1.0) != 1.0)
57 abort();
58 if (test2_1(2.0) != 4.0)
59 abort();
60 if (test2_1(0.0) != 0.0)
61 abort();
62 if (test2_1(-1.0) != 1.0)
63 abort();
64 if (test2_1(-2.0) != 4.0)
65 abort();
67 if (test2_2(1.0) != 1.0)
68 abort();
69 if (test2_2(2.0) != 4.0)
70 abort();
71 if (test2_2(0.0) != 0.0)
72 abort();
73 if (test2_2(-1.0) != 1.0)
74 abort();
75 if (test2_2(-2.0) != 4.0)
76 abort();
78 if (test2_3(1.0) != 1.0)
79 abort();
80 if (test2_3(2.0) != 4.0)
81 abort();
82 if (test2_3(0.0) != 0.0)
83 abort();
84 if (test2_3(-1.0) != 1.0)
85 abort();
86 if (test2_3(2.0) != 4.0)
87 abort();
89 if (test3_1(1.0) != 1.0)
90 abort();
91 if (test3_1(2.0) != 8.0)
92 abort();
93 if (test3_1(0.0) != 0.0)
94 abort();
95 if (test3_1(-1.0) != -1.0)
96 abort();
97 if (test3_1(-2.0) != -8.0)
98 abort();
100 if (test3_2(1.0) != -1.0)
101 abort();
102 if (test3_2(2.0) != -8.0)
103 abort();
104 if (test3_2(0.0) != -0.0)
105 abort();
106 if (test3_2(-1.0) != 1.0)
107 abort();
108 if (test3_2(-2.0) != 8.0)
109 abort();
111 if (test3_3(1.0) != 1.0)
112 abort();
113 if (test3_3(2.0) != 8.0)
114 abort();
115 if (test3_3(0.0) != 0.0)
116 abort();
117 if (test3_3(-1.0) != 1.0)
118 abort();
119 if (test3_3(-2.0) != 8.0)
120 abort();
122 if (test6_1(1.0) != 1.0)
123 abort();
124 if (test6_1(2.0) != 64.0)
125 abort();
126 if (test6_1(0.0) != 0.0)
127 abort();
128 if (test6_1(-1.0) != 1.0)
129 abort();
130 if (test6_1(-2.0) != 64.0)
131 abort();
133 if (test6_2(1.0) != 1.0)
134 abort();
135 if (test6_2(2.0) != 64.0)
136 abort();
137 if (test6_2(0.0) != 0.0)
138 abort();
139 if (test6_2(-1.0) != 1.0)
140 abort();
141 if (test6_2(-2.0) != 64.0)
142 abort();
144 if (test6_3(1.0) != 1.0)
145 abort();
146 if (test6_3(2.0) != 64.0)
147 abort();
148 if (test6_3(0.0) != 0.0)
149 abort();
150 if (test6_3(-1.0) != 1.0)
151 abort();
152 if (test6_3(-2.0) != 64.0)
153 abort();
155 return 0;