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

Unified Diff: test/NaCl/X86/ro-jumptable.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/X86/pnacl-hides-sandbox-x86-64.ll ('k') | test/NaCl/X86/stack-adjust.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/X86/ro-jumptable.ll
diff --git a/test/NaCl/X86/ro-jumptable.ll b/test/NaCl/X86/ro-jumptable.ll
new file mode 100644
index 0000000000000000000000000000000000000000..9defc1b88e8899c4c94bd9281e29fa0539cce655
--- /dev/null
+++ b/test/NaCl/X86/ro-jumptable.ll
@@ -0,0 +1,74 @@
+; RUN: llc -mtriple=i386-unknown-nacl -filetype=asm %s -o - \
+; RUN: | FileCheck %s
+
+declare i32 @bar(i32)
+
+; CHECK-LABEL: @foo
+; Check that the jump table for the switch goes in .rodata
+; CHECK: .section .rodata
+; CHECK: .long .LBB0
+define void @foo(i32 %a) {
+entry:
+ switch i32 %a, label %sw.epilog [
+ i32 3, label %sw.bb
+ i32 2, label %sw.bb1
+ i32 1, label %sw.bb3
+ i32 0, label %sw.bb5
+ ]
+
+sw.bb: ; preds = %entry
+ %call = call i32 @bar(i32 1)
+ br label %sw.bb1
+
+sw.bb1: ; preds = %entry, %sw.bb
+ %call2 = call i32 @bar(i32 2)
+ br label %sw.bb3
+
+sw.bb3: ; preds = %entry, %sw.bb1
+ %call4 = call i32 @bar(i32 3)
+ br label %sw.bb5
+
+sw.bb5: ; preds = %entry, %sw.bb3
+ %call6 = call i32 @bar(i32 4)
+ br label %sw.epilog
+
+sw.epilog: ; preds = %sw.bb5, %entry
+ ret void
+}
+
+
+; CHECK: .section .text.foo_linkonce,"axG",@progbits,foo_linkonce,comdat
+; CHECK: @foo_linkonce
+; Check that the jump table for the linkonce_odr function goes into a comdat
+; group uniqued like the function
+; CHECK: .section .rodata.foo_linkonce,"aG",@progbits,foo_linkonce,comdat
+; CHECK: .long .LBB1
+define linkonce_odr void @foo_linkonce(i32 %a) {
+entry:
+ switch i32 %a, label %sw.epilog [
+ i32 3, label %sw.bb
+ i32 2, label %sw.bb1
+ i32 1, label %sw.bb3
+ i32 0, label %sw.bb5
+ ]
+
+sw.bb: ; preds = %entry
+ %call = call i32 @bar(i32 1)
+ br label %sw.bb1
+
+sw.bb1: ; preds = %entry, %sw.bb
+ %call2 = call i32 @bar(i32 2)
+ br label %sw.bb3
+
+sw.bb3: ; preds = %entry, %sw.bb1
+ %call4 = call i32 @bar(i32 3)
+ br label %sw.bb5
+
+sw.bb5: ; preds = %entry, %sw.bb3
+ %call6 = call i32 @bar(i32 4)
+ br label %sw.epilog
+
+sw.epilog: ; preds = %sw.bb5, %entry
+ ret void
+}
+
« no previous file with comments | « test/NaCl/X86/pnacl-hides-sandbox-x86-64.ll ('k') | test/NaCl/X86/stack-adjust.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698