2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / builtins-61.c
blobdff163ff112e5d724af02865c1ad2bd6036c5e7a
1 /* { dg-do compile } */
2 /* { dg-options "-O -ffast-math -fdump-tree-optimized" } */
3 /* { dg-require-effective-target c99_runtime } */
5 double test1 (double x)
7 return __real __builtin_cexp(x * (__extension__ 1.0iF));
10 double test2(double x)
12 return __imag __builtin_cexp((__extension__ 1.0iF) * x);
15 double test3(double x)
17 _Complex c = __builtin_cexp(x * (__extension__ 1.0iF));
18 return __imag c + __real c;
21 double test4(double x, double y)
23 _Complex c = __builtin_cexp(x);
24 x = __builtin_exp (x);
25 return x - __real c;
28 /* { dg-final { scan-tree-dump "cexpi" "optimized" } } */
29 /* { dg-final { scan-tree-dump "sin" "optimized" } } */
30 /* { dg-final { scan-tree-dump "cos" "optimized" } } */
31 /* { dg-final { scan-tree-dump "return 0.0" "optimized" } } */
32 /* { dg-final { cleanup-tree-dump "optimized" } } */