1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -dce -S | FileCheck %s
3 ; RUN: opt < %s -passes=dce -S | FileCheck %s
5 declare double @acos(double) nounwind willreturn
6 declare double @asin(double) nounwind willreturn
7 declare double @atan(double) nounwind willreturn
8 declare double @atan2(double, double) nounwind willreturn
9 declare double @ceil(double) nounwind willreturn
10 declare double @cos(double) nounwind willreturn
11 declare double @cosh(double) nounwind willreturn
12 declare double @exp(double) nounwind willreturn
13 declare double @exp2(double) nounwind willreturn
14 declare double @fabs(double) nounwind willreturn
15 declare double @floor(double) nounwind willreturn
16 declare double @fmod(double, double) nounwind willreturn
17 declare double @log(double) nounwind willreturn
18 declare double @log10(double) nounwind willreturn
19 declare double @pow(double, double) nounwind willreturn
20 declare double @sin(double) nounwind willreturn
21 declare double @sinh(double) nounwind willreturn
22 declare double @sqrt(double) nounwind willreturn
23 declare double @tan(double) nounwind willreturn
24 declare double @tanh(double) nounwind willreturn
26 declare float @acosf(float) nounwind willreturn
27 declare float @asinf(float) nounwind willreturn
28 declare float @atanf(float) nounwind willreturn
29 declare float @atan2f(float, float) nounwind willreturn
30 declare float @ceilf(float) nounwind willreturn
31 declare float @cosf(float) nounwind willreturn
32 declare float @coshf(float) nounwind willreturn
33 declare float @expf(float) nounwind willreturn
34 declare float @exp2f(float) nounwind willreturn
35 declare float @fabsf(float) nounwind willreturn
36 declare float @floorf(float) nounwind willreturn
37 declare float @fmodf(float, float) nounwind willreturn
38 declare float @logf(float) nounwind willreturn
39 declare float @log10f(float) nounwind willreturn willreturn
40 declare float @powf(float, float) nounwind willreturn
41 declare float @sinf(float) nounwind willreturn
42 declare float @sinhf(float) nounwind willreturn
43 declare float @sqrtf(float) nounwind willreturn
44 declare float @tanf(float) nounwind willreturn
45 declare float @tanhf(float) nounwind willreturn
50 ; CHECK-NEXT: [[LOG1:%.*]] = call double @log(double 0.000000e+00)
51 ; CHECK-NEXT: [[LOG2:%.*]] = call double @log(double -1.000000e+00)
52 ; CHECK-NEXT: [[EXP2:%.*]] = call double @exp(double 1.000000e+03)
53 ; CHECK-NEXT: [[COS2:%.*]] = call double @cos(double 0x7FF0000000000000)
54 ; CHECK-NEXT: [[COS3:%.*]] = call double @cos(double 0.000000e+00) [[ATTR2:#.*]]
55 ; CHECK-NEXT: [[FMOD2:%.*]] = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
56 ; CHECK-NEXT: ret void
60 ; log(0) produces a pole error
61 %log1 = call double @log(double 0.000000e+00)
63 ; log(-1) produces a domain error
64 %log2 = call double @log(double -1.000000e+00)
67 %log3 = call double @log(double 1.000000e+00)
69 ; exp(100) is roughly 2.6e+43
70 %exp1 = call double @exp(double 1.000000e+02)
72 ; exp(1000) is a range error
73 %exp2 = call double @exp(double 1.000000e+03)
76 %cos1 = call double @cos(double 0.000000e+00)
78 ; cos(inf) is a domain error
79 %cos2 = call double @cos(double 0x7FF0000000000000)
81 ; cos(0) nobuiltin may have side effects
82 %cos3 = call double @cos(double 0.000000e+00) nobuiltin
85 %pow1 = call double @pow(double 0x7FF0000000000000, double 1.000000e+00)
87 ; pow(0, -1) is a pole error
88 ; FIXME: It fails on mingw host. Suppress checking.
89 ; %pow2 = call double @pow(double 0.000000e+00, double -1.000000e+00)
91 ; fmod(inf, nan) is nan
92 %fmod1 = call double @fmod(double 0x7FF0000000000000, double 0x7FF0000000000001)
94 ; fmod(inf, 1) is a domain error
95 %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
100 define void @Tstrict() strictfp {
101 ; CHECK-LABEL: @Tstrict(
103 ; CHECK-NEXT: [[COS4:%.*]] = call double @cos(double 1.000000e+00) [[ATTR1:#.*]]
104 ; CHECK-NEXT: ret void
108 ; cos(1) strictfp sets FP status flags
109 %cos4 = call double @cos(double 1.000000e+00) strictfp