OSDN Git Service

PR tree-optimization/30843
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-40.c
1 /* Copyright (C) 2004 Free Software Foundation.
2
3    Check that fmod, fmodf, fmodl, drem, dremf, dreml,
4    remainder, remainderf and remainderl
5    built-in functions compile.
6
7    Written by Uros Bizjak, 5th May 2004.  */
8
9 /* { dg-do compile } */
10 /* { dg-options "-O2" } */
11
12 extern double fmod(double, double);
13 extern float fmodf(float, float);
14 extern long double fmodl(long double, long double);
15
16 extern double remainder(double, double);
17 extern float remainderf(float, float);
18 extern long double remainderl(long double, long double);
19
20 extern double drem(double, double);
21 extern float dremf(float, float);
22 extern long double dreml(long double, long double);
23
24
25 double test1(double x, double y)
26 {
27   return fmod(x, y);
28 }
29
30 float test1f(float x, float y)
31 {
32   return fmodf(x, y);
33 }
34
35 long double test1l(long double x, long double y)
36 {
37   return fmodl(x, y);
38 }
39
40 double test2(double x, double y)
41 {
42   return remainder(x, y);
43 }
44
45 float test2f(float x, float y)
46 {
47   return remainderf(x, y);
48 }
49
50 long double test2l(long double x, long double y)
51 {
52   return remainderl(x, y);
53 }
54
55 double test3(double x, double y)
56 {
57   return drem(x, y);
58 }
59
60 float test3f(float x, float y)
61 {
62   return dremf(x, y);
63 }
64
65 long double test3l(long double x, long double y)
66 {
67   return dreml(x, y);
68 }