]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/builtins-62.c
db62696938e39dcfa47751257fe138b04e3ae8ee
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / builtins-62.c
1 /* { dg-do compile } */
2 /* { dg-options "-O -ffinite-math-only -fdump-tree-optimized" } */
3 /* { dg-require-effective-target c99_runtime } */
4
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
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
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
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" } } */