summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-05-20 06:02:09 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-05-20 06:02:09 +0000
commit2ac8b324eb4de4507858dcd33ce03ef9973bf1f3 (patch)
tree1057d4174f5df12cb6c75d52bab911f076150940 /test
parentc7d167d62fbf7ab3a31aed6c6fa0d5f7525ccb30 (diff)
downloadllvm-2ac8b324eb4de4507858dcd33ce03ef9973bf1f3.tar.gz
llvm-2ac8b324eb4de4507858dcd33ce03ef9973bf1f3.tar.bz2
llvm-2ac8b324eb4de4507858dcd33ce03ef9973bf1f3.tar.xz
Fix for PR4235: to build a floating-point value from integer parts,
build an integer and cast that to a float. This fixes a crash caused by trying to split an f32 into two f16's. This changes the behavior in test/CodeGen/XCore/fneg.ll because that testcase now triggers a DAGCombine which converts the fneg into an integer operation. If someone is interested, it's probably possible to tweak the test to generate an actual fneg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll11
-rw-r--r--test/CodeGen/XCore/fneg.ll2
2 files changed, 12 insertions, 1 deletions
diff --git a/test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll b/test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll
new file mode 100644
index 0000000000..20050e93ac
--- /dev/null
+++ b/test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=msp430
+
+define i16 @test(double %d) nounwind {
+entry:
+ %add = add double %d, 1.000000e+00
+ %call = tail call i16 @funct(double %add) nounwind
+ ret i16 %call
+}
+
+declare i16 @funct(double)
+
diff --git a/test/CodeGen/XCore/fneg.ll b/test/CodeGen/XCore/fneg.ll
index ac30410cf8..e4426fd908 100644
--- a/test/CodeGen/XCore/fneg.ll
+++ b/test/CodeGen/XCore/fneg.ll
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
-; RUN: grep "bl __subdf3" %t1.s | count 1
+; RUN: grep "xor" %t1.s | count 1
define i1 @test(double %F) nounwind {
entry:
%0 = sub double -0.000000e+00, %F