Debian Codegraph @

gcc/testsuite/gcc.dg/sinatan-2.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -fdump-tree-optimized" } */
3 /* { dg-require-effective-target c99_runtime } */
4
5 extern float sinf (float);
6 extern float cosf (float);
7 extern float atanf (float);
8 extern double sin (double);
9 extern double cos (double);
10 extern double atan (double);
11 extern long double sinl (long double);
12 extern long double cosl (long double);
13 extern long double atanl (long double);
14
15 double __attribute__ ((noinline))
16 sinatan_ (double x)
17 {
18 return sin (atan (x));
19 }
20
21 double __attribute__ ((noinline))
22 cosatan_ (double x)
23 {
24 return cos (atan (x));
25 }
26
27 float __attribute__ ((noinline))
28 sinatanf_(float x)
29 {
30 return sinf (atanf (x));
31 }
32
33 float __attribute__ ((noinline))
34 cosatanf_(float x)
35 {
36 return cosf (atanf (x));
37 }
38
39 long double __attribute__ ((noinline))
40 sinatanl_ (long double x)
41 {
42 return sinl (atanl (x));
43 }
44
45 long double __attribute__ ((noinline))
46 cosatanl_ (long double x)
47 {
48 return cosl (atanl (x));
49 }
50
51 /* There must be no calls to sin, cos, or atan */
52 /* { dg-final { scan-tree-dump-not "sin " "optimized" } } */
53 /* { dg-final { scan-tree-dump-not "cos " "optimized" } } */
54 /* { dg-final { scan-tree-dump-not "atan " "optimized" } } */
55 /* { dg-final { scan-tree-dump-not "sinf " "optimized" } } */
56 /* { dg-final { scan-tree-dump-not "cosf " "optimized" } } */
57 /* { dg-final { scan-tree-dump-not "atanf " "optimized" } } */
58 /* { dg-final { scan-tree-dump-not "sinl " "optimized" } } */
59 /* { dg-final { scan-tree-dump-not "cosl " "optimized" } } */
60 /* { dg-final { scan-tree-dump-not "atanl " "optimized" } } */