summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/XCore/2009-01-08-Crash.ll
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2009-01-15 11:32:30 +0000
committerRichard Osborne <richard@xmos.com>2009-01-15 11:32:30 +0000
commit40119780a8bd4c3846771a5b30ec231048053999 (patch)
tree2c1174e379717787b76cab1a451785ad29db1c27 /llvm/test/CodeGen/XCore/2009-01-08-Crash.ll
parent502b91a35cf61abcef292504c4db916c1abebd80 (diff)
downloadbcm5719-llvm-40119780a8bd4c3846771a5b30ec231048053999.tar.gz
bcm5719-llvm-40119780a8bd4c3846771a5b30ec231048053999.zip
Don't fold address calculations which use negative offsets into
the ADDRspii addressing mode. llvm-svn: 62258
Diffstat (limited to 'llvm/test/CodeGen/XCore/2009-01-08-Crash.ll')
-rw-r--r--llvm/test/CodeGen/XCore/2009-01-08-Crash.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/XCore/2009-01-08-Crash.ll b/llvm/test/CodeGen/XCore/2009-01-08-Crash.ll
new file mode 100644
index 00000000000..6f5fb7c6871
--- /dev/null
+++ b/llvm/test/CodeGen/XCore/2009-01-08-Crash.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -march=xcore > %t1.s
+;; This caused a compilation failure since the
+;; address arithmetic was folded into the LDWSP instruction,
+;; resulting in a negative offset which eliminateFrameIndex was
+;; unable to eliminate.
+define i32 @test(i32 %bar) nounwind readnone {
+entry:
+ %bar_addr = alloca i32
+ %0 = getelementptr i32* %bar_addr, i32 -1
+ %1 = load i32* %0, align 4
+ ret i32 %1
+}
OpenPOWER on IntegriCloud