diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-08-31 18:19:35 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-08-31 18:19:35 +0000 |
commit | bc870037f66cc2e9096241c573bf1b7211fccf7b (patch) | |
tree | f9aa1247eae479103fd32384fb983f65fb7b7838 /test/Transforms/InstCombine/win-math.ll | |
parent | c94e7b50c36ce866772e269f1541f49cbf114d27 (diff) | |
download | llvm-bc870037f66cc2e9096241c573bf1b7211fccf7b.tar.gz llvm-bc870037f66cc2e9096241c573bf1b7211fccf7b.tar.bz2 llvm-bc870037f66cc2e9096241c573bf1b7211fccf7b.tar.xz |
SimplifyLibCalls: When emitting an overloaded fp function check that it's available.
The existing code missed some edge cases when e.g. we're going to emit sqrtf but
only the availability of sqrt was checked. This happens on odd platforms like
windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/win-math.ll')
-rw-r--r-- | test/Transforms/InstCombine/win-math.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/win-math.ll b/test/Transforms/InstCombine/win-math.ll index df3ac934a7..e6e79e2b84 100644 --- a/test/Transforms/InstCombine/win-math.ll +++ b/test/Transforms/InstCombine/win-math.ll @@ -273,3 +273,23 @@ define float @float_round(float %x) nounwind readnone { ret float %3 } +declare float @powf(float, float) +; win32 lacks sqrtf&fabsf, win64 lacks fabsf +define float @float_powsqrt(float %x) nounwind readnone { +; WIN32-LABEL: @float_powsqrt( +; WIN32-NOT: float @sqrtf +; WIN32: float @powf +; WIN64-LABEL: @float_powsqrt( +; WIN64-NOT: float @sqrtf +; WIN64: float @powf +; MINGW32-LABEL: @float_powsqrt( +; MINGW32: float @sqrtf +; MINGW32: float @fabsf +; MINGW32-NOT: float @powf +; MINGW64-LABEL: @float_powsqrt( +; MINGW64: float @sqrtf +; MINGW64: float @fabsf +; MINGW64-NOT: float @powf + %1 = call float @powf(float %x, float 0.5) + ret float %1 +} |