summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-09-17 01:38:06 +0000
committerDan Gohman <gohman@apple.com>2010-09-17 01:38:06 +0000
commit18fa17cf3db3ae4d947c4920e3b05666be1e4661 (patch)
treee10c658982df713fc325d2de06ef2b3717482e7b /llvm/test/Transforms
parent3f7796fc223db72945c1209f71625f1acab87f57 (diff)
downloadbcm5719-llvm-18fa17cf3db3ae4d947c4920e3b05666be1e4661.tar.gz
bcm5719-llvm-18fa17cf3db3ae4d947c4920e3b05666be1e4661.zip
Fix the folding of floating-point math library calls, like sin(infinity),
so that it detects errors on platforms where libm doesn't set errno. It's still subject to host libm details though. llvm-svn: 114148
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/fold-calls.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fold-calls.ll b/llvm/test/Transforms/InstCombine/fold-calls.ll
new file mode 100644
index 00000000000..2b11771969f
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/fold-calls.ll
@@ -0,0 +1,19 @@
+; RUN: opt -instcombine -S < %s | FileCheck %s
+
+; This shouldn't fold, because sin(inf) is invalid.
+; CHECK: @foo
+; CHECK: %t = call double @sin(double 0x7FF0000000000000)
+define double @foo() {
+ %t = call double @sin(double 0x7FF0000000000000)
+ ret double %t
+}
+
+; This should fold.
+; CHECK: @bar
+; CHECK: ret double 0x3FDA6026360C2F91
+define double @bar() {
+ %t = call double @sin(double 9.0)
+ ret double %t
+}
+
+declare double @sin(double)
OpenPOWER on IntegriCloud