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

Unified Diff: test/NaCl/Bitcode/switch.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/Bitcode/ptrtoint-elide.ll ('k') | test/NaCl/Bitcode/switch-ptr.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/Bitcode/switch.ll
diff --git a/test/NaCl/Bitcode/switch.ll b/test/NaCl/Bitcode/switch.ll
new file mode 100644
index 0000000000000000000000000000000000000000..3d5ac91281cccec8f3a1b4d44d9d048ab9d8d2bb
--- /dev/null
+++ b/test/NaCl/Bitcode/switch.ll
@@ -0,0 +1,51 @@
+; Test that we no longer put VECTOR/ARRAY type entries, associated with
+; switch instructions, into the bitcode file.
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | pnacl-bcanalyzer -dump-records \
+; RUN: | FileCheck %s -check-prefix=PF2
+
+; Test case where we switch on a variable.
+define void @SwitchVariable(i32) {
+ switch i32 %0, label %l1 [
+ i32 1, label %l2
+ i32 2, label %l2
+ i32 4, label %l3
+ i32 5, label %l3
+ ]
+ br label %end
+l1:
+ br label %end
+l2:
+ br label %end
+l3:
+ br label %end
+end:
+ ret void
+}
+
+; Test case where we switch on a constant.
+define void @SwitchConstant(i32) {
+ switch i32 3, label %l1 [
+ i32 1, label %l2
+ i32 2, label %l2
+ i32 4, label %l3
+ i32 5, label %l3
+ ]
+ br label %end
+l1:
+ br label %end
+l2:
+ br label %end
+l3:
+ br label %end
+end:
+ ret void
+}
+
+; PF2: <TYPE_BLOCK_ID>
+; PF2-NEXT: <NUMENTRY op0=3/>
+; PF2-NEXT: <VOID/>
+; PF2-NEXT: <INTEGER op0=32/>
+; PF2-NEXT: <FUNCTION op0={{.*}} op1={{.*}} op2={{.*}}/>
+; PF2-NEXT: </TYPE_BLOCK_ID>
« no previous file with comments | « test/NaCl/Bitcode/ptrtoint-elide.ll ('k') | test/NaCl/Bitcode/switch-ptr.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698