OSDN Git Service

PR c/15052
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-34.c
1 /* Copyright (C) 2004 Free Software Foundation.
2
3    Check that exp10, exp10f, exp10l, exp2, exp2f, exp2l, pow10, pow10f,
4    pow10l, expm1, expm1f and expm1l built-in functions compile.
5
6    Written by Uros Bizjak, 13th February 2004.  */
7
8 /* { dg-do compile } */
9 /* { dg-options "-O2 -ffast-math" } */
10
11 extern double exp10(double);
12 extern double exp2(double);
13 extern double pow10(double);
14 extern double expm1(double);
15 extern float exp10f(float);
16 extern float exp2f(float);
17 extern float pow10f(float);
18 extern float expm1f(float);
19 extern long double exp10l(long double);
20 extern long double exp2l(long double);
21 extern long double pow10l(long double);
22 extern long double expm1l(long double);
23
24
25 double test1(double x)
26 {
27   return exp10(x);
28 }
29
30 double test2(double x)
31 {
32   return exp2(x);
33 }
34
35 double test3(double x)
36 {
37   return pow10(x);
38 }
39
40 double test4(double x)
41 {
42   return expm1(x);
43 }
44
45 float test1f(float x)
46 {
47   return exp10f(x);
48 }
49
50 float test2f(float x)
51 {
52   return exp2f(x);
53 }
54
55 float test3f(float x)
56 {
57   return pow10f(x);
58 }
59
60 float test4f(float x)
61 {
62   return expm1f(x);
63 }
64
65 long double test1l(long double x)
66 {
67   return exp10l(x);
68 }
69
70 long double test2l(long double x)
71 {
72   return exp2l(x);
73 }
74
75 long double test3l(long double x)
76 {
77   return pow10l(x);
78 }
79
80 long double test4l(long double x)
81 {
82   return expm1l(x);
83 }
84