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

Side by Side Diff: tests_lit/llvm2ice_tests/switch-opt.ll

Issue 1387963002: Make sure that all globals are internal, except for "start" functions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix new tests. Created 5 years, 2 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
« no previous file with comments | « tests_lit/llvm2ice_tests/store.ll ('k') | tests_lit/llvm2ice_tests/undef.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This tests a switch statement, including multiple branches to the 1 ; This tests a switch statement, including multiple branches to the
2 ; same label which also results in phi instructions with multiple 2 ; same label which also results in phi instructions with multiple
3 ; entries for the same incoming edge. 3 ; entries for the same incoming edge.
4 4
5 ; For x86 see adv-switch-opt.ll 5 ; For x86 see adv-switch-opt.ll
6 6
7 ; TODO(jvoung): Update to -02 once the phi assignments is done for ARM 7 ; TODO(jvoung): Update to -02 once the phi assignments is done for ARM
8 ; RUN: %if --need=target_ARM32 --need=allow_dump \ 8 ; RUN: %if --need=target_ARM32 --need=allow_dump \
9 ; RUN: --command %p2i --filetype=asm --assemble --disassemble \ 9 ; RUN: --command %p2i --filetype=asm --assemble --disassemble \
10 ; RUN: --target arm32 -i %s --args -Om1 --skip-unimplemented \ 10 ; RUN: --target arm32 -i %s --args -Om1 --skip-unimplemented \
11 ; RUN: | %if --need=target_ARM32 --need=allow_dump \ 11 ; RUN: | %if --need=target_ARM32 --need=allow_dump \
12 ; RUN: --command FileCheck --check-prefix ARM32 %s 12 ; RUN: --command FileCheck --check-prefix ARM32 %s
13 13
14 define i32 @testSwitch(i32 %a) { 14 define internal i32 @testSwitch(i32 %a) {
15 entry: 15 entry:
16 switch i32 %a, label %sw.default [ 16 switch i32 %a, label %sw.default [
17 i32 1, label %sw.epilog 17 i32 1, label %sw.epilog
18 i32 2, label %sw.epilog 18 i32 2, label %sw.epilog
19 i32 3, label %sw.epilog 19 i32 3, label %sw.epilog
20 i32 7, label %sw.bb1 20 i32 7, label %sw.bb1
21 i32 8, label %sw.bb1 21 i32 8, label %sw.bb1
22 i32 15, label %sw.bb2 22 i32 15, label %sw.bb2
23 i32 14, label %sw.bb2 23 i32 14, label %sw.bb2
24 ] 24 ]
(...skipping 12 matching lines...) Expand all
37 37
38 sw.epilog: ; preds = %sw.bb2, %sw.default , %entry, %entry, %entry 38 sw.epilog: ; preds = %sw.bb2, %sw.default , %entry, %entry, %entry
39 %result.1 = phi i32 [ %add, %sw.default ], [ %result.0, %sw.bb2 ], [ 17, %entr y ], [ 17, %entry ], [ 17, %entry ] 39 %result.1 = phi i32 [ %add, %sw.default ], [ %result.0, %sw.bb2 ], [ 17, %entr y ], [ 17, %entry ], [ 17, %entry ]
40 ret i32 %result.1 40 ret i32 %result.1
41 } 41 }
42 42
43 ; Check for a valid addressing mode when the switch operand is an 43 ; Check for a valid addressing mode when the switch operand is an
44 ; immediate. It's important that there is exactly one case, because 44 ; immediate. It's important that there is exactly one case, because
45 ; for two or more cases the source operand is legalized into a 45 ; for two or more cases the source operand is legalized into a
46 ; register. 46 ; register.
47 define i32 @testSwitchImm() { 47 define internal i32 @testSwitchImm() {
48 entry: 48 entry:
49 switch i32 10, label %sw.default [ 49 switch i32 10, label %sw.default [
50 i32 1, label %sw.default 50 i32 1, label %sw.default
51 ] 51 ]
52 52
53 sw.default: 53 sw.default:
54 ret i32 20 54 ret i32 20
55 } 55 }
56 ; ARM32-LABEL: testSwitchImm 56 ; ARM32-LABEL: testSwitchImm
57 ; ARM32: cmp {{r[0-9]+}}, #1 57 ; ARM32: cmp {{r[0-9]+}}, #1
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 ; ARM32: movw [[REG:r[0-9]+]], #30864 98 ; ARM32: movw [[REG:r[0-9]+]], #30864
99 ; ARM32-NEXT: movt [[REG]], #13398 99 ; ARM32-NEXT: movt [[REG]], #13398
100 ; ARM32-NEXT: cmp {{r[0-9]+}}, [[REG]] 100 ; ARM32-NEXT: cmp {{r[0-9]+}}, [[REG]]
101 ; ARM32-NEXT: cmpeq {{r[0-9]+}}, #18 101 ; ARM32-NEXT: cmpeq {{r[0-9]+}}, #18
102 ; ARM32-NEXT: beq 102 ; ARM32-NEXT: beq
103 ; ARM32-NEXT: b 103 ; ARM32-NEXT: b
104 104
105 ; Similar to testSwitchImm, make sure proper addressing modes are 105 ; Similar to testSwitchImm, make sure proper addressing modes are
106 ; used. In reality, this is tested by running the output through the 106 ; used. In reality, this is tested by running the output through the
107 ; assembler. 107 ; assembler.
108 define i32 @testSwitchImm64() { 108 define internal i32 @testSwitchImm64() {
109 entry: 109 entry:
110 switch i64 10, label %sw.default [ 110 switch i64 10, label %sw.default [
111 i64 1, label %sw.default 111 i64 1, label %sw.default
112 ] 112 ]
113 113
114 sw.default: 114 sw.default:
115 ret i32 20 115 ret i32 20
116 } 116 }
117 ; ARM32-LABEL: testSwitchImm64 117 ; ARM32-LABEL: testSwitchImm64
118 ; ARM32: cmp {{r[0-9]+}}, #1 118 ; ARM32: cmp {{r[0-9]+}}, #1
119 ; ARM32-NEXT: cmpeq {{r[0-9]+}}, #0 119 ; ARM32-NEXT: cmpeq {{r[0-9]+}}, #0
120 ; ARM32-NEXT: beq [[ADDR:[0-9a-f]+]] 120 ; ARM32-NEXT: beq [[ADDR:[0-9a-f]+]]
121 ; ARM32-NEXT: b [[ADDR]] 121 ; ARM32-NEXT: b [[ADDR]]
122 122
123 define i32 @testSwitchUndef64() { 123 define internal i32 @testSwitchUndef64() {
124 entry: 124 entry:
125 switch i64 undef, label %sw.default [ 125 switch i64 undef, label %sw.default [
126 i64 1, label %sw.default 126 i64 1, label %sw.default
127 ] 127 ]
128 128
129 sw.default: 129 sw.default:
130 ret i32 20 130 ret i32 20
131 } 131 }
132 ; ARM32-LABEL: testSwitchUndef64 132 ; ARM32-LABEL: testSwitchUndef64
133 ; ARM32: movw {{.*}}, #0 133 ; ARM32: movw {{.*}}, #0
134 ; ARM32: movw {{.*}}, #0 134 ; ARM32: movw {{.*}}, #0
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/store.ll ('k') | tests_lit/llvm2ice_tests/undef.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698