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