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

Unified Diff: test/NaCl/Bitcode/switch-ptr.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/switch.ll ('k') | test/NaCl/Bitcode/unsupported.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/Bitcode/switch-ptr.ll
diff --git a/test/NaCl/Bitcode/switch-ptr.ll b/test/NaCl/Bitcode/switch-ptr.ll
new file mode 100644
index 0000000000000000000000000000000000000000..bab44cd1ce87018bbfa9d12753b0699213263a21
--- /dev/null
+++ b/test/NaCl/Bitcode/switch-ptr.ll
@@ -0,0 +1,27 @@
+; Tests if we handle pointer argument for switch statement.
+; https://code.google.com/p/nativeclient/issues/detail?id=4050
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | pnacl-thaw \
+; RUN: | llvm-dis -o - | FileCheck %s
+
+@hi = internal global [1 x i8] zeroinitializer, align 1
+define internal void @foo() {
+ %e = ptrtoint [1 x i8]* @hi to i32
+ switch i32 %e, label %baz3 [
+ i32 -4, label %baz1
+ i32 -8, label %baz2
+ ]
+baz1:
+ ret void
+baz2:
+ ret void
+baz3:
+ ret void
+}
+
+; CHECK-LABEL: @foo
+; CHECK: %1 = ptrtoint [1 x i8]* @hi to i32
+; CHECK-NEXT: switch i32 %1, label
+; CHECK-NEXT: i32
+; CHECK-NEXT: i32
« no previous file with comments | « test/NaCl/Bitcode/switch.ll ('k') | test/NaCl/Bitcode/unsupported.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698