1 /* { dg-do compile } */ 2 /* { dg-options "-O -ffast-math -fdump-tree-optimized" } */ 3 /* { dg-require-effective-target c99_runtime } */ 4 /* { dg-require-effective-target libc_has_complex_functions } */ 5 test1(double x)6double test1 (double x) 7 { 8 return __real __builtin_cexp(x * (__extension__ 1.0iF)); 9 } 10 test2(double x)11double test2(double x) 12 { 13 return __imag __builtin_cexp((__extension__ 1.0iF) * x); 14 } 15 test3(double x)16double test3(double x) 17 { 18 _Complex c = __builtin_cexp(x * (__extension__ 1.0iF)); 19 return __imag c + __real c; 20 } 21 test4(double x,double y)22double test4(double x, double y) 23 { 24 _Complex c = __builtin_cexp(x); 25 x = __builtin_exp (x); 26 return x - __real c; 27 } 28 29 /* { dg-final { scan-tree-dump "cexpi" "optimized" } } */ 30 /* { dg-final { scan-tree-dump "sin" "optimized" } } */ 31 /* { dg-final { scan-tree-dump "cos" "optimized" } } */ 32 /* { dg-final { scan-tree-dump "return 0.0" "optimized" } } */ 33