1; RUN: opt < %s -dce -S | FileCheck %s 2 3declare double @acos(double) nounwind 4declare double @asin(double) nounwind 5declare double @atan(double) nounwind 6declare double @atan2(double, double) nounwind 7declare double @ceil(double) nounwind 8declare double @cos(double) nounwind 9declare double @cosh(double) nounwind 10declare double @exp(double) nounwind 11declare double @exp2(double) nounwind 12declare double @fabs(double) nounwind 13declare double @floor(double) nounwind 14declare double @fmod(double, double) nounwind 15declare double @log(double) nounwind 16declare double @log10(double) nounwind 17declare double @pow(double, double) nounwind 18declare double @sin(double) nounwind 19declare double @sinh(double) nounwind 20declare double @sqrt(double) nounwind 21declare double @tan(double) nounwind 22declare double @tanh(double) nounwind 23 24declare float @acosf(float) nounwind 25declare float @asinf(float) nounwind 26declare float @atanf(float) nounwind 27declare float @atan2f(float, float) nounwind 28declare float @ceilf(float) nounwind 29declare float @cosf(float) nounwind 30declare float @coshf(float) nounwind 31declare float @expf(float) nounwind 32declare float @exp2f(float) nounwind 33declare float @fabsf(float) nounwind 34declare float @floorf(float) nounwind 35declare float @fmodf(float, float) nounwind 36declare float @logf(float) nounwind 37declare float @log10f(float) nounwind 38declare float @powf(float, float) nounwind 39declare float @sinf(float) nounwind 40declare float @sinhf(float) nounwind 41declare float @sqrtf(float) nounwind 42declare float @tanf(float) nounwind 43declare float @tanhf(float) nounwind 44 45define void @T() { 46entry: 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; 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 78 79; cos(1) strictfp sets FP status flags 80; CHECK-NEXT: %cos4 = call double @cos(double 1.000000e+00) 81 %cos4 = call double @cos(double 1.000000e+00) strictfp 82 83; pow(0, 1) is 0 84 %pow1 = call double @pow(double 0x7FF0000000000000, double 1.000000e+00) 85 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) 89 90; fmod(inf, nan) is nan 91 %fmod1 = call double @fmod(double 0x7FF0000000000000, double 0x7FF0000000000001) 92 93; fmod(inf, 1) is a domain error 94; CHECK-NEXT: %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00) 95 %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00) 96 97; CHECK-NEXT: ret void 98 ret void 99} 100