OSDN Git Service

22ea04aa8f36341a702b26f5bfcaf777153ca8e1
[android-x86/external-llvm.git] / test / Transforms / DCE / calls-errno.ll
1 ; RUN: opt < %s -dce -S | FileCheck %s
2
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
23
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
44
45 define void @T() {
46 entry:
47 ; CHECK-LABEL: @T(
48 ; CHECK-NEXT: entry:
49
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)
53
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)
57
58 ; log(1) is 0
59   %log3 = call double @log(double 1.000000e+00)
60
61 ; exp(100) is roughly 2.6e+43
62   %exp1 = call double @exp(double 1.000000e+02)
63
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)
67
68 ; cos(0) is 1
69   %cos1 = call double @cos(double 0.000000e+00)
70
71 ; cos(inf) is a domain error
72 ; CHECK-NEXT: %cos2 = call double @cos(double 0x7FF0000000000000)
73   %cos2 = call double @cos(double 0x7FF0000000000000)
74
75 ; pow(0, 1) is 0
76   %pow1 = call double @pow(double 0x7FF0000000000000, double 1.000000e+00)
77
78 ; pow(0, -1) is a pole error
79 ; FIXME: It fails on mingw host. Suppress checking.
80 ; %pow2 = call double @pow(double 0.000000e+00, double -1.000000e+00)
81
82 ; fmod(inf, nan) is nan
83   %fmod1 = call double @fmod(double 0x7FF0000000000000, double 0x7FF0000000000001)
84
85 ; fmod(inf, 1) is a domain error
86 ; CHECK-NEXT: %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
87   %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
88
89 ; CHECK-NEXT: ret void
90   ret void
91 }