1 /* { dg-do compile } */
2 /* { dg-options "-O -ffinite-math-only -fdump-tree-optimized" } */
3 /* { dg-require-effective-target c99_runtime } */
4 
test1(double x)5 double test1 (double x)
6 {
7   double s, c;
8   s = __builtin_sin (x);
9   c = __builtin_cos (x);
10   return s + c;
11 }
12 
test2(double x)13 double test2 (double x)
14 {
15   double s, c;
16   x = x * 2;
17   s = __builtin_sin (x);
18   c = __builtin_cos (x);
19   return s + c;
20 }
21 
test3(double x,int b)22 double test3 (double x, int b)
23 {
24   double s, c;
25   if (b)
26     x = x * 2;
27   s = __builtin_sin (x);
28   c = __builtin_cos (x);
29   return s + c;
30 }
31 
test4(double x)32 double test4 (double x)
33 {
34   double s;
35   x = x * 2;
36   s = __builtin_sin (x);
37   return s;
38 }
39 
40 /* { dg-final { scan-tree-dump-times "cexpi" 3 "optimized" } } */
41 /* { dg-final { cleanup-tree-dump "optimized" } } */
42