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

Side by Side Diff: tests_lit/llvm2ice_tests/div_legalization.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/convert.ll ('k') | tests_lit/llvm2ice_tests/ebp_args.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 is a regression test that idiv and div operands are legalized 1 ; This is a regression test that idiv and div operands are legalized
2 ; (they cannot be constants and can only be reg/mem for x86). 2 ; (they cannot be constants and can only be reg/mem for x86).
3 3
4 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s 4 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s
5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s
6 6
7 define i32 @Sdiv_const8_b(i8 %a) { 7 define internal i32 @Sdiv_const8_b(i8 %a) {
8 ; CHECK-LABEL: Sdiv_const8_b 8 ; CHECK-LABEL: Sdiv_const8_b
9 entry: 9 entry:
10 %div = sdiv i8 %a, 12 10 %div = sdiv i8 %a, 12
11 ; CHECK: mov {{.*}},0xc 11 ; CHECK: mov {{.*}},0xc
12 ; CHECK-NOT: idiv 0xc 12 ; CHECK-NOT: idiv 0xc
13 %div_ext = sext i8 %div to i32 13 %div_ext = sext i8 %div to i32
14 ret i32 %div_ext 14 ret i32 %div_ext
15 } 15 }
16 16
17 define i32 @Sdiv_const16_b(i16 %a) { 17 define internal i32 @Sdiv_const16_b(i16 %a) {
18 ; CHECK-LABEL: Sdiv_const16_b 18 ; CHECK-LABEL: Sdiv_const16_b
19 entry: 19 entry:
20 %div = sdiv i16 %a, 1234 20 %div = sdiv i16 %a, 1234
21 ; CHECK: mov {{.*}},0x4d2 21 ; CHECK: mov {{.*}},0x4d2
22 ; CHECK-NOT: idiv 0x4d2 22 ; CHECK-NOT: idiv 0x4d2
23 %div_ext = sext i16 %div to i32 23 %div_ext = sext i16 %div to i32
24 ret i32 %div_ext 24 ret i32 %div_ext
25 } 25 }
26 26
27 define i32 @Sdiv_const32_b(i32 %a) { 27 define internal i32 @Sdiv_const32_b(i32 %a) {
28 ; CHECK-LABEL: Sdiv_const32_b 28 ; CHECK-LABEL: Sdiv_const32_b
29 entry: 29 entry:
30 %div = sdiv i32 %a, 1234 30 %div = sdiv i32 %a, 1234
31 ; CHECK: mov {{.*}},0x4d2 31 ; CHECK: mov {{.*}},0x4d2
32 ; CHECK-NOT: idiv 0x4d2 32 ; CHECK-NOT: idiv 0x4d2
33 ret i32 %div 33 ret i32 %div
34 } 34 }
35 35
36 define i32 @Srem_const_b(i32 %a) { 36 define internal i32 @Srem_const_b(i32 %a) {
37 ; CHECK-LABEL: Srem_const_b 37 ; CHECK-LABEL: Srem_const_b
38 entry: 38 entry:
39 %rem = srem i32 %a, 2345 39 %rem = srem i32 %a, 2345
40 ; CHECK: mov {{.*}},0x929 40 ; CHECK: mov {{.*}},0x929
41 ; CHECK-NOT: idiv 0x929 41 ; CHECK-NOT: idiv 0x929
42 ret i32 %rem 42 ret i32 %rem
43 } 43 }
44 44
45 define i32 @Udiv_const_b(i32 %a) { 45 define internal i32 @Udiv_const_b(i32 %a) {
46 ; CHECK-LABEL: Udiv_const_b 46 ; CHECK-LABEL: Udiv_const_b
47 entry: 47 entry:
48 %div = udiv i32 %a, 3456 48 %div = udiv i32 %a, 3456
49 ; CHECK: mov {{.*}},0xd80 49 ; CHECK: mov {{.*}},0xd80
50 ; CHECK-NOT: div 0xd80 50 ; CHECK-NOT: div 0xd80
51 ret i32 %div 51 ret i32 %div
52 } 52 }
53 53
54 define i32 @Urem_const_b(i32 %a) { 54 define internal i32 @Urem_const_b(i32 %a) {
55 ; CHECK-LABEL: Urem_const_b 55 ; CHECK-LABEL: Urem_const_b
56 entry: 56 entry:
57 %rem = urem i32 %a, 4567 57 %rem = urem i32 %a, 4567
58 ; CHECK: mov {{.*}},0x11d7 58 ; CHECK: mov {{.*}},0x11d7
59 ; CHECK-NOT: div 0x11d7 59 ; CHECK-NOT: div 0x11d7
60 ret i32 %rem 60 ret i32 %rem
61 } 61 }
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/convert.ll ('k') | tests_lit/llvm2ice_tests/ebp_args.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698