summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-07-16 01:34:27 +0000
committerReid Kleckner <reid@kleckner.net>2014-07-16 01:34:27 +0000
commit56b56ea15bd8687d9a9f1279c91eb0939cee7a56 (patch)
treedb18a11c0d573cda0b929752f346dce0905a72aa /llvm/test/Bitcode
parentb4db99c76ab3b0eed1a90b142aa420960adb2ae4 (diff)
downloadbcm5719-llvm-56b56ea15bd8687d9a9f1279c91eb0939cee7a56.tar.gz
bcm5719-llvm-56b56ea15bd8687d9a9f1279c91eb0939cee7a56.zip
Roundtrip the inalloca bit on allocas through bitcode
This was an oversight in the original support. As it is, I stuffed this bit into the alignment. The alignment is stored in log2 form, so it doesn't need more than 5 bits, given that Value::MaximumAlignment is 1 << 29. Reviewers: nicholas Differential Revision: http://reviews.llvm.org/D3943 llvm-svn: 213118
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/inalloca.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/inalloca.ll b/llvm/test/Bitcode/inalloca.ll
new file mode 100644
index 00000000000..bad87a9b03f
--- /dev/null
+++ b/llvm/test/Bitcode/inalloca.ll
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+
+; inalloca should roundtrip.
+
+define void @foo(i32* inalloca %args) {
+ ret void
+}
+; CHECK-LABEL: define void @foo(i32* inalloca %args)
+
+define void @bar() {
+ ; Use the maximum alignment, since we stuff our bit with alignment.
+ %args = alloca inalloca i32, align 536870912
+ call void @foo(i32* inalloca %args)
+ ret void
+}
+; CHECK-LABEL: define void @bar() {
+; CHECK: %args = alloca inalloca i32, align 536870912
+; CHECK: call void @foo(i32* inalloca %args)
OpenPOWER on IntegriCloud