annotate gcc/testsuite/gcc.dg/builtins-61.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O -ffast-math -fdump-tree-optimized" } */
kono
parents:
diff changeset
3 /* { dg-require-effective-target c99_runtime } */
kono
parents:
diff changeset
4 /* { dg-require-effective-target libc_has_complex_functions } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 double test1 (double x)
kono
parents:
diff changeset
7 {
kono
parents:
diff changeset
8 return __real __builtin_cexp(x * (__extension__ 1.0iF));
kono
parents:
diff changeset
9 }
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 double test2(double x)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 return __imag __builtin_cexp((__extension__ 1.0iF) * x);
kono
parents:
diff changeset
14 }
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 double test3(double x)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 _Complex c = __builtin_cexp(x * (__extension__ 1.0iF));
kono
parents:
diff changeset
19 return __imag c + __real c;
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 double test4(double x, double y)
kono
parents:
diff changeset
23 {
kono
parents:
diff changeset
24 _Complex c = __builtin_cexp(x);
kono
parents:
diff changeset
25 x = __builtin_exp (x);
kono
parents:
diff changeset
26 return x - __real c;
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 /* { dg-final { scan-tree-dump "cexpi" "optimized" } } */
kono
parents:
diff changeset
30 /* { dg-final { scan-tree-dump "sin" "optimized" } } */
kono
parents:
diff changeset
31 /* { dg-final { scan-tree-dump "cos" "optimized" } } */
kono
parents:
diff changeset
32 /* { dg-final { scan-tree-dump "return 0.0" "optimized" } } */