This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / testsuite / gcc.dg / pr19402-2.c
blob1902227a6e061395e63b46561dc52eae92f22e48
1 /* { dg-do run } */
2 /* { dg-options "-fno-inline -Os" } */
4 void abort(void);
7 float powif(float x, int n)
9 return __builtin_powif(x, n);
12 double powi(double x, int n)
14 return __builtin_powi(x, n);
17 long double powil(long double x, int n)
19 return __builtin_powil(x, n);
23 float powcif(float x)
25 return __builtin_powif(x, 5);
28 double powci(double x)
30 return __builtin_powi(x, 5);
33 long double powcil(long double x)
35 return __builtin_powil(x, 5);
39 float powicf(int n)
41 return __builtin_powif(2.0, n);
44 double powic(int n)
46 return __builtin_powi(2.0, n);
49 long double powicl(int n)
51 return __builtin_powil(2.0, n);
55 int main()
57 if (__builtin_powi(1.0, 5) != 1.0)
58 abort();
59 if (__builtin_powif(1.0, 5) != 1.0)
60 abort();
61 if (__builtin_powil(1.0, 5) != 1.0)
62 abort();
63 if (powci(1.0) != 1.0)
64 abort();
65 if (powcif(1.0) != 1.0)
66 abort();
67 if (powcil(1.0) != 1.0)
68 abort();
69 if (powi(1.0, -5) != 1.0)
70 abort();
71 if (powif(1.0, -5) != 1.0)
72 abort();
73 if (powil(1.0, -5) != 1.0)
74 abort();
75 if (powic(1) != 2.0)
76 abort();
77 if (powicf(1) != 2.0)
78 abort();
79 if (powicl(1) != 2.0)
80 abort();
81 return 0;