OSDN Git Service

* gcc.dg/builtins-1.c: New testcase.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-1.c
1 /* Copyright (C) 2002  Free Software Foundation.
2
3    Verify that all the __builtin_ math functions are recognized
4    by the compiler.
5
6    Written by Roger Sayle, 11th July 2002.  */
7
8 /* { dg-do compile } */
9 /* { dg-final { scan-assembler-not "__builtin_" } } */
10
11 double test1(double x) { return __builtin_sqrt(x); }
12 double test2(double x) { return __builtin_cos(x); }
13 double test3(double x) { return __builtin_sin(x); }
14 double test4(double x) { return __builtin_exp(x); }
15 double test5(double x) { return __builtin_log(x); }
16
17 float test1f(float x) { return __builtin_sqrtf(x); }
18 float test2f(float x) { return __builtin_cosf(x); }
19 float test3f(float x) { return __builtin_sinf(x); }
20 float test4f(float x) { return __builtin_expf(x); }
21 float test5f(float x) { return __builtin_logf(x); }
22
23 long double test1l(long double x) { return __builtin_sqrtl(x); }
24 long double test2l(long double x) { return __builtin_cosl(x); }
25 long double test3l(long double x) { return __builtin_sinl(x); }
26 long double test4l(long double x) { return __builtin_expl(x); }
27 long double test5l(long double x) { return __builtin_logl(x); }
28