OSDN Git Service

Target Hook to issue diagnostics for AltiVec argument to funtion
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-46.c
1 /* Copyright (C) 2004 Free Software Foundation.
2
3    Check that rint, rintf, rintl, floor, floorf, floorl,
4    ceil, ceilf, ceill, trunc, truncf, truncl,
5    nearbyint, nearbyintf and nearbyintl
6    built-in functions compile.
7
8    Written by Uros Bizjak, 25th Aug 2004.  */
9
10 /* { dg-do compile } */
11 /* { dg-options "-O2 -ffast-math" } */
12
13 extern double rint(double);
14 extern double floor(double);
15 extern double ceil(double);
16 extern double trunc(double);
17 extern double nearbyint(double);
18
19 extern float rintf(float);
20 extern float floorf(float);
21 extern float ceilf(float);
22 extern float truncf(float);
23 extern float nearbyintf(float);
24
25 extern long double rintl(long double);
26 extern long double floorl(long double);
27 extern long double ceill(long double);
28 extern long double truncl(long double);
29 extern long double nearbyintl(long double);
30
31
32 double test1(double x)
33 {
34   return rint(x);
35 }
36
37 double test2(double x)
38 {
39   return floor(x);
40 }
41
42 double test3(double x)
43 {
44   return ceil(x);
45 }
46
47 double test4(double x)
48 {
49   return trunc(x);
50 }
51
52 double test5(double x)
53 {
54   return nearbyint(x);
55 }
56
57 float test1f(float x)
58 {
59   return rintf(x);
60 }
61
62 float test2f(float x)
63 {
64   return floorf(x);
65 }
66
67 float test3f(float x)
68 {
69   return ceilf(x);
70 }
71
72 float test4f(float x)
73 {
74   return truncf(x);
75 }
76
77 float test5f(float x)
78 {
79   return nearbyintf(x);
80 }
81
82 long double test1l(long double x)
83 {
84   return rintl(x);
85 }
86
87 long double test2l(long double x)
88 {
89   return floorl(x);
90 }
91
92 long double test3l(long double x)
93 {
94   return ceill(x);
95 }
96
97 long double test4l(long double x)
98 {
99   return truncl(x);
100 }
101
102 long double test5l(long double x)
103 {
104   return nearbyintl(x);
105 }