summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2011-12-01 22:14:50 +0000
committerChad Rosier <mcrosier@apple.com>2011-12-01 22:14:50 +0000
commit3367123b1233c7dcabc6ccc80461d76e3170f5cb (patch)
tree1d74ea32bbd9da48c1324cdfcef9c367fdf713ae /llvm/test
parent4393d6bd05fe7ef16ad6970538b66681c8578066 (diff)
downloadbcm5719-llvm-3367123b1233c7dcabc6ccc80461d76e3170f5cb.tar.gz
bcm5719-llvm-3367123b1233c7dcabc6ccc80461d76e3170f5cb.zip
Prevent library calls from being folded if -fno-builtin has been specified.
rdar://10500969 llvm-svn: 145639
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/ConstProp/calls.ll79
1 files changed, 79 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ConstProp/calls.ll b/llvm/test/Transforms/ConstProp/calls.ll
index 3b6010a0dc3..b3ea122406c 100644
--- a/llvm/test/Transforms/ConstProp/calls.ll
+++ b/llvm/test/Transforms/ConstProp/calls.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -constprop -S | FileCheck %s
+; RUN: opt < %s -constprop -disable-simplify-libcalls -S | FileCheck %s --check-prefix=FNOBUILTIN
declare double @cos(double)
@@ -59,3 +60,81 @@ declare i32 @llvm.x86.sse2.cvtsd2si(<2 x double>) nounwind readnone
declare i32 @llvm.x86.sse2.cvttsd2si(<2 x double>) nounwind readnone
declare i64 @llvm.x86.sse2.cvtsd2si64(<2 x double>) nounwind readnone
declare i64 @llvm.x86.sse2.cvttsd2si64(<2 x double>) nounwind readnone
+
+; Shouldn't fold because of -fno-builtin
+define double @sin_() nounwind uwtable ssp {
+; FNOBUILTIN: @sin_
+; FNOBUILTIN: %1 = call double @sin(double 3.000000e+00)
+ %1 = call double @sin(double 3.000000e+00)
+ ret double %1
+}
+
+; Shouldn't fold because of -fno-builtin
+define double @sqrt_() nounwind uwtable ssp {
+; FNOBUILTIN: @sqrt_
+; FNOBUILTIN: %1 = call double @sqrt(double 3.000000e+00)
+ %1 = call double @sqrt(double 3.000000e+00)
+ ret double %1
+}
+
+; Shouldn't fold because of -fno-builtin
+define float @sqrtf_() nounwind uwtable ssp {
+; FNOBUILTIN: @sqrtf_
+; FNOBUILTIN: %1 = call float @sqrtf(float 3.000000e+00)
+ %1 = call float @sqrtf(float 3.000000e+00)
+ ret float %1
+}
+declare float @sqrtf(float)
+
+; Shouldn't fold because of -fno-builtin
+define float @sinf_() nounwind uwtable ssp {
+; FNOBUILTIN: @sinf_
+; FNOBUILTIN: %1 = call float @sinf(float 3.000000e+00)
+ %1 = call float @sinf(float 3.000000e+00)
+ ret float %1
+}
+declare float @sinf(float)
+
+; Shouldn't fold because of -fno-builtin
+define double @tan_() nounwind uwtable ssp {
+; FNOBUILTIN: @tan_
+; FNOBUILTIN: %1 = call double @tan(double 3.000000e+00)
+ %1 = call double @tan(double 3.000000e+00)
+ ret double %1
+}
+
+; Shouldn't fold because of -fno-builtin
+define double @tanh_() nounwind uwtable ssp {
+; FNOBUILTIN: @tanh_
+; FNOBUILTIN: %1 = call double @tanh(double 3.000000e+00)
+ %1 = call double @tanh(double 3.000000e+00)
+ ret double %1
+}
+declare double @tanh(double)
+
+; Shouldn't fold because of -fno-builtin
+define double @pow_() nounwind uwtable ssp {
+; FNOBUILTIN: @pow_
+; FNOBUILTIN: %1 = call double @pow(double 3.000000e+00, double 3.000000e+00)
+ %1 = call double @pow(double 3.000000e+00, double 3.000000e+00)
+ ret double %1
+}
+declare double @pow(double, double)
+
+; Shouldn't fold because of -fno-builtin
+define double @fmod_() nounwind uwtable ssp {
+; FNOBUILTIN: @fmod_
+; FNOBUILTIN: %1 = call double @fmod(double 3.000000e+00, double 3.000000e+00)
+ %1 = call double @fmod(double 3.000000e+00, double 3.000000e+00)
+ ret double %1
+}
+declare double @fmod(double, double)
+
+; Shouldn't fold because of -fno-builtin
+define double @atan2_() nounwind uwtable ssp {
+; FNOBUILTIN: @atan2_
+; FNOBUILTIN: %1 = call double @atan2(double 3.000000e+00, double 3.000000e+00)
+ %1 = call double @atan2(double 3.000000e+00, double 3.000000e+00)
+ ret double %1
+}
+declare double @atan2(double, double)
OpenPOWER on IntegriCloud