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

Side by Side Diff: test/NaCl/Bitcode/pnacl-bcdis/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 unified diff | Download patch
OLDNEW
(Empty)
1 ; Test switch statements.
2
3 ; RUN: llvm-as < %s | pnacl-freeze | pnacl-bccompress --remove-abbreviations \
4 ; RUN: | pnacl-bcdis | FileCheck %s
5
6
7 ; Test case where we switch on a variable.
8 define void @SwitchVariable(i32 %p0) {
9
10 ; CHECK: | | %b0:
11
12 switch i32 %p0, label %b1 [
13 i32 1, label %b2
14 i32 2, label %b2
15 i32 4, label %b3
16 i32 5, label %b3
17 ]
18
19 ; CHECK-NEXT: {{.*}}| 3: <12, 1, 1, 1, 4, 1, 1,| switch i32 %p0 {
20 ; CHECK-NEXT: | 2, 2, 1, 1, 4, 2, 1, | default: br label %b 1;
21 ; CHECK-NEXT: | 1, 8, 3, 1, 1, 10, 3>| i32 1: br label %b2;
22 ; CHECK-NEXT: | | i32 2: br label %b2;
23 ; CHECK-NEXT: | | i32 4: br label %b3;
24 ; CHECK-NEXT: | | i32 5: br label %b3;
25 ; CHECK-NEXT: | | }
26
27 b1:
28 br label %b4
29
30
31 b2:
32 br label %b4
33
34 b3:
35 br label %b4
36
37 b4:
38 ret void
39 }
40
41 ; Test case where we switch on a constant.
42 define void @SwitchConstant() {
43
44 ; CHECK: | | %b0:
45
46 switch i32 3, label %b1 [
47 i32 2, label %b2
48 i32 1, label %b2
49 i32 5, label %b3
50 i32 4, label %b3
51 ]
52
53 ; CHECK-NEXT: {{.*}}| 3: <12, 1, 1, 1, 4, 1, 1,| switch i32 %c0 {
54 ; CHECK-NEXT: | 4, 2, 1, 1, 2, 2, 1, | default: br label %b 1;
55 ; CHECK-NEXT: | 1, 10, 3, 1, 1, 8, 3>| i32 2: br label %b2;
56 ; CHECK-NEXT: | | i32 1: br label %b2;
57 ; CHECK-NEXT: | | i32 5: br label %b3;
58 ; CHECK-NEXT: | | i32 4: br label %b3;
59 ; CHECK-NEXT: | | }
60
61 b1:
62 br label %b4
63
64 b2:
65 br label %b4
66
67 b3:
68 br label %b4
69
70 b4:
71 ret void
72 }
73
OLDNEW
« no previous file with comments | « test/NaCl/Bitcode/pnacl-bcdis/store.ll ('k') | test/NaCl/Bitcode/pnacl-bcdis/types-and-fcn-addrs.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698