Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: test/NaCl/Bitcode/alloca-operand.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/NaCl/ARM/vstr-sandboxing1.ll ('k') | test/NaCl/Bitcode/bcanalyzer-width.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/Bitcode/alloca-operand.ll
diff --git a/test/NaCl/Bitcode/alloca-operand.ll b/test/NaCl/Bitcode/alloca-operand.ll
new file mode 100644
index 0000000000000000000000000000000000000000..fcabead6c7a7a06d57220016d5f8153597e60646
--- /dev/null
+++ b/test/NaCl/Bitcode/alloca-operand.ll
@@ -0,0 +1,29 @@
+; RUN: llvm-as < %s | pnacl-freeze | pnacl-bcanalyzer -dump-records \
+; RUN: | FileCheck %s
+
+; Test that alloca's size operand is represented with a relative value
+; ID, the same as other instructions' operands.
+
+define external void @_start(i32 %arg) {
+; CHECK: <FUNCTION_BLOCK
+; CHECK: </CONSTANTS_BLOCK>
+
+ %size = mul i32 %arg, 4
+; CHECK-NEXT: <INST_BINOP
+ alloca i8, i32 %size
+; CHECK-NEXT: <INST_ALLOCA op0=1
+
+ ; Since the operand reference is a relative ID, references to %size
+ ; go up by 1 with each instruction.
+ alloca i8, i32 %size
+; CHECK-NEXT: <INST_ALLOCA op0=2
+ alloca i8, i32 %size
+; CHECK-NEXT: <INST_ALLOCA op0=3
+
+ ; Reference to a Constant operand.
+ alloca i8, i32 256
+; CHECK-NEXT: <INST_ALLOCA op0=5
+
+ ret void
+; CHECK-NEXT: <INST_RET/>
+}
« no previous file with comments | « test/NaCl/ARM/vstr-sandboxing1.ll ('k') | test/NaCl/Bitcode/bcanalyzer-width.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698