summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-05-06 21:09:44 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-05-06 21:09:44 +0000
commit64c92844118f740cb08749f7ca3e0a8f2ef99c85 (patch)
treebd30a4e952736eff880431dbdcc9902bd3ea2b69 /llvm/test/Bitcode
parentd26fc5e0131a0f75012c2b490651d2928ff0211d (diff)
downloadbcm5719-llvm-64c92844118f740cb08749f7ca3e0a8f2ef99c85.tar.gz
bcm5719-llvm-64c92844118f740cb08749f7ca3e0a8f2ef99c85.zip
It's valid to take the blockaddress of a different function, so remove this
assert in the bitcode writer. No change needed because the ValueEnumerator holds a whole-module numbering anyhow. Fixes PR9857! llvm-svn: 131016
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/blockaddress.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/blockaddress.ll b/llvm/test/Bitcode/blockaddress.ll
new file mode 100644
index 00000000000..b9f334176ca
--- /dev/null
+++ b/llvm/test/Bitcode/blockaddress.ll
@@ -0,0 +1,30 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+; PR9857
+
+define void @f(i8** nocapture %ptr1) {
+; CHECK: define void @f
+entry:
+ br label %here.i
+
+here.i:
+ store i8* blockaddress(@doit, %here), i8** %ptr1, align 8
+; CHECK: blockaddress(@doit, %here)
+ br label %doit.exit
+
+doit.exit:
+ ret void
+}
+
+define void @doit(i8** nocapture %pptr) {
+; CHECK: define void @doit
+entry:
+ br label %here
+
+here:
+ store i8* blockaddress(@doit, %here), i8** %pptr, align 8
+; CHECK: blockaddress(@doit, %here)
+ br label %end
+
+end:
+ ret void
+}
OpenPOWER on IntegriCloud