1 ; RUN: opt < %s -dce -S | FileCheck %s
3 declare double @acos(double) nounwind
4 declare double @asin(double) nounwind
5 declare double @atan(double) nounwind
6 declare double @atan2(double, double) nounwind
7 declare double @ceil(double) nounwind
8 declare double @cos(double) nounwind
9 declare double @cosh(double) nounwind
10 declare double @exp(double) nounwind
11 declare double @exp2(double) nounwind
12 declare double @fabs(double) nounwind
13 declare double @floor(double) nounwind
14 declare double @fmod(double, double) nounwind
15 declare double @log(double) nounwind
16 declare double @log10(double) nounwind
17 declare double @pow(double, double) nounwind
18 declare double @sin(double) nounwind
19 declare double @sinh(double) nounwind
20 declare double @sqrt(double) nounwind
21 declare double @tan(double) nounwind
22 declare double @tanh(double) nounwind
24 declare float @acosf(float) nounwind
25 declare float @asinf(float) nounwind
26 declare float @atanf(float) nounwind
27 declare float @atan2f(float, float) nounwind
28 declare float @ceilf(float) nounwind
29 declare float @cosf(float) nounwind
30 declare float @coshf(float) nounwind
31 declare float @expf(float) nounwind
32 declare float @exp2f(float) nounwind
33 declare float @fabsf(float) nounwind
34 declare float @floorf(float) nounwind
35 declare float @fmodf(float, float) nounwind
36 declare float @logf(float) nounwind
37 declare float @log10f(float) nounwind
38 declare float @powf(float, float) nounwind
39 declare float @sinf(float) nounwind
40 declare float @sinhf(float) nounwind
41 declare float @sqrtf(float) nounwind
42 declare float @tanf(float) nounwind
43 declare float @tanhf(float) nounwind
50 ; log(0) produces a pole error
51 ; CHECK-NEXT: %log1 = call double @log(double 0.000000e+00)
52 %log1 = call double @log(double 0.000000e+00)
54 ; log(-1) produces a domain error
55 ; CHECK-NEXT: %log2 = call double @log(double -1.000000e+00)
56 %log2 = call double @log(double -1.000000e+00)
59 %log3 = call double @log(double 1.000000e+00)
61 ; exp(100) is roughly 2.6e+43
62 %exp1 = call double @exp(double 1.000000e+02)
64 ; exp(1000) is a range error
65 ; CHECK-NEXT: %exp2 = call double @exp(double 1.000000e+03)
66 %exp2 = call double @exp(double 1.000000e+03)
69 %cos1 = call double @cos(double 0.000000e+00)
71 ; cos(inf) is a domain error
72 ; CHECK-NEXT: %cos2 = call double @cos(double 0x7FF0000000000000)
73 %cos2 = call double @cos(double 0x7FF0000000000000)
75 ; cos(0) nobuiltin may have side effects
76 ; CHECK-NEXT: %cos3 = call double @cos(double 0.000000e+00)
77 %cos3 = call double @cos(double 0.000000e+00) nobuiltin
80 %pow1 = call double @pow(double 0x7FF0000000000000, double 1.000000e+00)
82 ; pow(0, -1) is a pole error
83 ; FIXME: It fails on mingw host. Suppress checking.
84 ; %pow2 = call double @pow(double 0.000000e+00, double -1.000000e+00)
86 ; fmod(inf, nan) is nan
87 %fmod1 = call double @fmod(double 0x7FF0000000000000, double 0x7FF0000000000001)
89 ; fmod(inf, 1) is a domain error
90 ; CHECK-NEXT: %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
91 %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
93 ; CHECK-NEXT: ret void
97 define void @Tstrict() strictfp {
99 ; CHECK-LABEL: @Tstrict(
102 ; cos(1) strictfp sets FP status flags
103 ; CHECK-NEXT: %cos4 = call double @cos(double 1.000000e+00)
104 %cos4 = call double @cos(double 1.000000e+00) strictfp
106 ; CHECK-NEXT: ret void