summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-03-04 20:01:52 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-03-04 20:01:52 +0000
commitf8198e431160e7ca713b88dcf90715ae1b03e6ed (patch)
tree37d3b42d11136248c037e89b0b247df3b5b5dceb /llvm/test
parentdfb0ad30a87eb77eeda5faf35d4ad61f0c631322 (diff)
downloadbcm5719-llvm-f8198e431160e7ca713b88dcf90715ae1b03e6ed.tar.gz
bcm5719-llvm-f8198e431160e7ca713b88dcf90715ae1b03e6ed.zip
Lowers block address. Currently asserts when relocation model is not PIC. Patch by Akira Hatanaka
llvm-svn: 127027
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/Mips/blockaddr.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/blockaddr.ll b/llvm/test/CodeGen/Mips/blockaddr.ll
new file mode 100644
index 00000000000..2b0631428c5
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/blockaddr.ll
@@ -0,0 +1,26 @@
+; RUN: llc -march=mipsel < %s | FileCheck %s
+
+@reg = common global i8* null, align 4
+
+define i8* @dummy(i8* %x) nounwind readnone noinline {
+entry:
+ ret i8* %x
+}
+
+; CHECK: lw $2, %got($tmp1)($gp)
+; CHECK: addiu $4, $2, %lo($tmp1)
+; CHECK: lw $2, %got($tmp2)($gp)
+; CHECK: addiu $2, $2, %lo($tmp2)
+define void @f() nounwind {
+entry:
+ %call = tail call i8* @dummy(i8* blockaddress(@f, %baz))
+ indirectbr i8* %call, [label %baz, label %foo]
+
+foo: ; preds = %foo, %entry
+ store i8* blockaddress(@f, %foo), i8** @reg, align 4
+ br label %foo
+
+baz: ; preds = %entry
+ store i8* null, i8** @reg, align 4
+ ret void
+}
OpenPOWER on IntegriCloud