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

Unified Diff: test/NaCl/PNaClABI/abi-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/PNaClABI/abi-stripped-pointers.ll ('k') | test/NaCl/PNaClABI/abi-varargs.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/PNaClABI/abi-switch.ll
diff --git a/test/NaCl/PNaClABI/abi-switch.ll b/test/NaCl/PNaClABI/abi-switch.ll
new file mode 100644
index 0000000000000000000000000000000000000000..8fd6b75ebb7bdcc74aa310ee6a56d7089921e799
--- /dev/null
+++ b/test/NaCl/PNaClABI/abi-switch.ll
@@ -0,0 +1,37 @@
+; RUN: not pnacl-abicheck < %s | FileCheck %s
+
+@var = internal global [4 x i8] c"xxxx"
+
+
+; CHECK-NOT: disallowed
+
+define internal void @bad_cases() {
+ ; ConstantExprs should be rejected here.
+ switch i32 ptrtoint ([4 x i8]* @var to i32), label %next [i32 0, label %next]
+; CHECK: disallowed: bad switch condition
+next:
+
+ ; Bad integer type.
+ switch i32 0, label %next [i99 0, label %next]
+; CHECK: bad switch case
+
+ ; Bad integer type.
+ switch i32 0, label %next [i32 0, label %next
+ i99 1, label %next]
+; CHECK: bad switch case
+
+ ; Note that the reader only allows ConstantInts in the label list.
+ ; We don't need to check the following, because the reader rejects
+ ; it:
+ ; switch i32 0, label %next [i32 ptrtoint (i32* @ptr to i32), label %next]
+
+ ret void
+}
+
+; CHECK-NOT: disallowed
+
+
+; This stops the verifier from complaining about the lack of an entry point.
+define void @_start(i32 %arg) {
+ ret void
+}
« no previous file with comments | « test/NaCl/PNaClABI/abi-stripped-pointers.ll ('k') | test/NaCl/PNaClABI/abi-varargs.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698