comparison gcc/testsuite/gcc.dg/sinhatanh-2.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -fdump-tree-optimized" } */
3
4 extern float sinhf (float);
5 extern float coshf (float);
6 extern float atanhf (float);
7 extern float sqrtf (float);
8 extern double sinh (double);
9 extern double cosh (double);
10 extern double atanh (double);
11 extern double sqrt (double);
12 extern long double sinhl (long double);
13 extern long double coshl (long double);
14 extern long double atanhl (long double);
15 extern long double sqrtl (long double);
16
17 float __attribute__ ((noinline))
18 coshatanhf_(float x)
19 {
20 float atg = atanhf(x);
21 return coshf(atg) + atg;
22 }
23
24 double __attribute__ ((noinline))
25 cosatan_(double x)
26 {
27 double atg = atanh(x);
28 return cosh(atg) + atg;
29 }
30
31 long double __attribute__ ((noinline))
32 cosatanl_(long double x)
33 {
34 long double atg = atanhl(x);
35 return coshl(atg) + atg;
36 }
37
38 float __attribute__ ((noinline))
39 sinatanf_(float x)
40 {
41 float atg = atanhf(x);
42 return sinhf(atg) + atg;
43 }
44
45 double __attribute__ ((noinline))
46 sinatan_(double x)
47 {
48 double atg = atanh(x);
49 return sinh(atg) + atg;
50 }
51
52 long double __attribute__ ((noinline))
53 sinatanl_(long double x)
54 {
55 long double atg = atanhl(x);
56 return sinhl(atg) + atg;
57 }
58
59 /* There should be calls to sinh, cosh and atanh */
60 /* { dg-final { scan-tree-dump-times "cosh " "1" "optimized" } } */
61 /* { dg-final { scan-tree-dump-times "sinh " "1" "optimized" } } */
62 /* { dg-final { scan-tree-dump-times "atanh " "2" "optimized" } } */
63 /* { dg-final { scan-tree-dump-times "coshf " "1" "optimized" } } */
64 /* { dg-final { scan-tree-dump-times "sinhf " "1" "optimized" } } */
65 /* { dg-final { scan-tree-dump-times "atanhf " "2" "optimized" } } */
66 /* { dg-final { scan-tree-dump-times "coshl " "1" "optimized" } } */
67 /* { dg-final { scan-tree-dump-times "sinhl " "1" "optimized" } } */
68 /* { dg-final { scan-tree-dump-times "atanhl " "2" "optimized" } } */