diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-12-01 22:14:50 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-12-01 22:14:50 +0000 |
commit | aebc3aae3fd3222c2588e9ad6812bd6cd370a385 (patch) | |
tree | 751366f64f54d36fb665828dcce0ec9e81b965fb /test/Transforms/ConstProp | |
parent | 85bef06a2e901933dac8054d59c27de21f08d025 (diff) | |
download | external_llvm-aebc3aae3fd3222c2588e9ad6812bd6cd370a385.zip external_llvm-aebc3aae3fd3222c2588e9ad6812bd6cd370a385.tar.gz external_llvm-aebc3aae3fd3222c2588e9ad6812bd6cd370a385.tar.bz2 |
Prevent library calls from being folded if -fno-builtin has been specified.
rdar://10500969
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ConstProp')
-rw-r--r-- | test/Transforms/ConstProp/calls.ll | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/test/Transforms/ConstProp/calls.ll b/test/Transforms/ConstProp/calls.ll index 3b6010a..b3ea122 100644 --- a/test/Transforms/ConstProp/calls.ll +++ b/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) |