]>
Commit | Line | Data |
---|---|---|
17684d46 RG |
1 | /* { dg-do run } */ |
2 | /* { dg-options "-fno-inline -Os" } */ | |
3 | ||
4 | void abort(void); | |
5 | ||
6 | ||
7 | float powif(float x, int n) | |
8 | { | |
9 | return __builtin_powif(x, n); | |
10 | } | |
11 | ||
12 | double powi(double x, int n) | |
13 | { | |
14 | return __builtin_powi(x, n); | |
15 | } | |
16 | ||
17 | long double powil(long double x, int n) | |
18 | { | |
19 | return __builtin_powil(x, n); | |
20 | } | |
21 | ||
22 | ||
23 | float powcif(float x) | |
24 | { | |
25 | return __builtin_powif(x, 5); | |
26 | } | |
27 | ||
28 | double powci(double x) | |
29 | { | |
30 | return __builtin_powi(x, 5); | |
31 | } | |
32 | ||
33 | long double powcil(long double x) | |
34 | { | |
35 | return __builtin_powil(x, 5); | |
36 | } | |
37 | ||
38 | ||
39 | float powicf(int n) | |
40 | { | |
41 | return __builtin_powif(2.0, n); | |
42 | } | |
43 | ||
44 | double powic(int n) | |
45 | { | |
46 | return __builtin_powi(2.0, n); | |
47 | } | |
48 | ||
49 | long double powicl(int n) | |
50 | { | |
51 | return __builtin_powil(2.0, n); | |
52 | } | |
53 | ||
54 | ||
55 | int main() | |
56 | { | |
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; | |
82 | } |