summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2017-12-16 01:26:25 +0000
committerHal Finkel <hfinkel@anl.gov>2017-12-16 01:26:25 +0000
commit1d4f2b0d25f03558bc816a4c8d147ff6508c3660 (patch)
tree8619804de16be952625ed24884cd967ac2379319 /unittests
parent625a9ef4f3f4c36a88583dd65af10a56c5e53533 (diff)
[SimplifyLibCalls] Inline calls to cabs when it's safe to do so
When unsafe algerbra is allowed calls to cabs(r) can be replaced by: sqrt(creal(r)*creal(r) + cimag(r)*cimag(r)) Patch by Paul Walker, thanks! Differential Revision: https://reviews.llvm.org/D40069 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Analysis/TargetLibraryInfoTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Analysis/TargetLibraryInfoTest.cpp b/unittests/Analysis/TargetLibraryInfoTest.cpp
index 9d852cf0301..ef558a434c7 100644
--- a/unittests/Analysis/TargetLibraryInfoTest.cpp
+++ b/unittests/Analysis/TargetLibraryInfoTest.cpp
@@ -131,6 +131,9 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare double @copysign(double, double)\n"
"declare float @copysignf(float, float)\n"
"declare x86_fp80 @copysignl(x86_fp80, x86_fp80)\n"
+ "declare double @cabs([2 x double])\n"
+ "declare float @cabsf([2 x float])\n"
+ "declare x86_fp80 @cabsl([2 x x86_fp80])\n"
"declare double @cos(double)\n"
"declare float @cosf(float)\n"
"declare double @cosh(double)\n"