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

Side by Side Diff: tests_lit/llvm2ice_tests/alloc.ll

Issue 914263005: Subzero: switch from llvm-objdump to objdump for lit tests (for LLVM merge) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fix some line wrap 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
« no previous file with comments | « tests_lit/llvm2ice_tests/align-spill-locations.ll ('k') | tests_lit/llvm2ice_tests/bitcast.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 basic test of the alloca instruction. 1 ; This is a basic test of the alloca instruction.
2 2
3 ; RUN: %p2i -i %s --args -O2 --verbose none \ 3 ; RUN: %p2i --assemble --disassemble -i %s --args -O2 --verbose none \
4 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ 4 ; RUN: | FileCheck %s
5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s 5 ; RUN: %p2i --assemble --disassemble -i %s --args -Om1 --verbose none \
6 ; RUN: %p2i -i %s --args -Om1 --verbose none \ 6 ; RUN: | FileCheck %s
7 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
9 7
10 define void @fixed_416_align_16(i32 %n) { 8 define void @fixed_416_align_16(i32 %n) {
11 entry: 9 entry:
12 %array = alloca i8, i32 416, align 16 10 %array = alloca i8, i32 416, align 16
13 %__2 = ptrtoint i8* %array to i32 11 %__2 = ptrtoint i8* %array to i32
14 call void @f1(i32 %__2) 12 call void @f1(i32 %__2)
15 ret void 13 ret void
16 } 14 }
17 ; CHECK-LABEL: fixed_416_align_16: 15 ; CHECK-LABEL: fixed_416_align_16
18 ; CHECK: sub esp, 416 16 ; CHECK: sub esp,0x1a0
19 ; CHECK: sub esp, 16 17 ; CHECK: sub esp,0x10
20 ; CHECK: mov dword ptr [esp], eax 18 ; CHECK: mov DWORD PTR [esp],eax
21 ; CHECK: call f1 19 ; CHECK: call {{.*}} R_{{.*}} f1
22 20
23 define void @fixed_416_align_32(i32 %n) { 21 define void @fixed_416_align_32(i32 %n) {
24 entry: 22 entry:
25 %array = alloca i8, i32 400, align 32 23 %array = alloca i8, i32 400, align 32
26 %__2 = ptrtoint i8* %array to i32 24 %__2 = ptrtoint i8* %array to i32
27 call void @f1(i32 %__2) 25 call void @f1(i32 %__2)
28 ret void 26 ret void
29 } 27 }
30 ; CHECK-LABEL: fixed_416_align_32: 28 ; CHECK-LABEL: fixed_416_align_32
31 ; CHECK: and esp, -32 29 ; CHECK: and esp,0xffffffe0
32 ; CHECK: sub esp, 416 30 ; CHECK: sub esp,0x1a0
33 ; CHECK: sub esp, 16 31 ; CHECK: sub esp,0x10
34 ; CHECK: mov dword ptr [esp], eax 32 ; CHECK: mov DWORD PTR [esp],eax
35 ; CHECK: call f1 33 ; CHECK: call {{.*}} R_{{.*}} f1
36 34
37 define void @fixed_351_align_16(i32 %n) { 35 define void @fixed_351_align_16(i32 %n) {
38 entry: 36 entry:
39 %array = alloca i8, i32 351, align 16 37 %array = alloca i8, i32 351, align 16
40 %__2 = ptrtoint i8* %array to i32 38 %__2 = ptrtoint i8* %array to i32
41 call void @f1(i32 %__2) 39 call void @f1(i32 %__2)
42 ret void 40 ret void
43 } 41 }
44 ; CHECK-LABEL: fixed_351_align_16: 42 ; CHECK-LABEL: fixed_351_align_16
45 ; CHECK: sub esp, 352 43 ; CHECK: sub esp,0x160
46 ; CHECK: sub esp, 16 44 ; CHECK: sub esp,0x10
47 ; CHECK: mov dword ptr [esp], eax 45 ; CHECK: mov DWORD PTR [esp],eax
48 ; CHECK: call f1 46 ; CHECK: call {{.*}} R_{{.*}} f1
49 47
50 define void @fixed_351_align_32(i32 %n) { 48 define void @fixed_351_align_32(i32 %n) {
51 entry: 49 entry:
52 %array = alloca i8, i32 351, align 32 50 %array = alloca i8, i32 351, align 32
53 %__2 = ptrtoint i8* %array to i32 51 %__2 = ptrtoint i8* %array to i32
54 call void @f1(i32 %__2) 52 call void @f1(i32 %__2)
55 ret void 53 ret void
56 } 54 }
57 ; CHECK-LABEL: fixed_351_align_32: 55 ; CHECK-LABEL: fixed_351_align_32
58 ; CHECK: and esp, -32 56 ; CHECK: and esp,0xffffffe0
59 ; CHECK: sub esp, 352 57 ; CHECK: sub esp,0x160
60 ; CHECK: sub esp, 16 58 ; CHECK: sub esp,0x10
61 ; CHECK: mov dword ptr [esp], eax 59 ; CHECK: mov DWORD PTR [esp],eax
62 ; CHECK: call f1 60 ; CHECK: call {{.*}} R_{{.*}} f1
63 61
64 define void @f1(i32 %ignored) { 62 declare void @f1(i32 %ignored)
65 entry:
66 ret void
67 }
68 63
69 define void @variable_n_align_16(i32 %n) { 64 define void @variable_n_align_16(i32 %n) {
70 entry: 65 entry:
71 %array = alloca i8, i32 %n, align 16 66 %array = alloca i8, i32 %n, align 16
72 %__2 = ptrtoint i8* %array to i32 67 %__2 = ptrtoint i8* %array to i32
73 call void @f2(i32 %__2) 68 call void @f2(i32 %__2)
74 ret void 69 ret void
75 } 70 }
76 ; CHECK-LABEL: variable_n_align_16: 71 ; CHECK-LABEL: variable_n_align_16
77 ; CHECK: mov eax, dword ptr [ebp + 8] 72 ; CHECK: mov eax,DWORD PTR [ebp+0x8]
78 ; CHECK: add eax, 15 73 ; CHECK: add eax,0xf
79 ; CHECK: and eax, -16 74 ; CHECK: and eax,0xfffffff0
80 ; CHECK: sub esp, eax 75 ; CHECK: sub esp,eax
81 ; CHECK: sub esp, 16 76 ; CHECK: sub esp,0x10
82 ; CHECK: mov dword ptr [esp], eax 77 ; CHECK: mov DWORD PTR [esp],eax
83 ; CHECK: call f2 78 ; CHECK: call {{.*}} R_{{.*}} f2
84 79
85 define void @variable_n_align_32(i32 %n) { 80 define void @variable_n_align_32(i32 %n) {
86 entry: 81 entry:
87 %array = alloca i8, i32 %n, align 32 82 %array = alloca i8, i32 %n, align 32
88 %__2 = ptrtoint i8* %array to i32 83 %__2 = ptrtoint i8* %array to i32
89 call void @f2(i32 %__2) 84 call void @f2(i32 %__2)
90 ret void 85 ret void
91 } 86 }
92 ; In -O2, the order of the CHECK-DAG lines in the output is switched. 87 ; In -O2, the order of the CHECK-DAG lines in the output is switched.
93 ; CHECK-LABEL: variable_n_align_32: 88 ; CHECK-LABEL: variable_n_align_32
94 ; CHECK-DAG: and esp, -32 89 ; CHECK-DAG: and esp,0xffffffe0
95 ; CHECK-DAG: mov eax, dword ptr [ebp + 8] 90 ; CHECK-DAG: mov eax,DWORD PTR [ebp+0x8]
96 ; CHECK: add eax, 31 91 ; CHECK: add eax,0x1f
97 ; CHECK: and eax, -32 92 ; CHECK: and eax,0xffffffe0
98 ; CHECK: sub esp, eax 93 ; CHECK: sub esp,eax
99 ; CHECK: sub esp, 16 94 ; CHECK: sub esp,0x10
100 ; CHECK: mov dword ptr [esp], eax 95 ; CHECK: mov DWORD PTR [esp],eax
101 ; CHECK: call f2 96 ; CHECK: call {{.*}} R_{{.*}} f2
102 97
103 ; Test alloca with default (0) alignment. 98 ; Test alloca with default (0) alignment.
104 define void @align0(i32 %n) { 99 define void @align0(i32 %n) {
105 entry: 100 entry:
106 %array = alloca i8, i32 %n 101 %array = alloca i8, i32 %n
107 %__2 = ptrtoint i8* %array to i32 102 %__2 = ptrtoint i8* %array to i32
108 call void @f2(i32 %__2) 103 call void @f2(i32 %__2)
109 ret void 104 ret void
110 } 105 }
111 ; CHECK-LABEL: align0 106 ; CHECK-LABEL: align0
112 ; CHECK: add [[REG:.*]], 15 107 ; CHECK: add [[REG:.*]],0xf
113 ; CHECK: and [[REG]], -16 108 ; CHECK: and [[REG]],0xfffffff0
114 ; CHECK: sub esp, [[REG]] 109 ; CHECK: sub esp,[[REG]]
115 110
116 define void @f2(i32 %ignored) { 111 declare void @f2(i32 %ignored)
117 entry:
118 ret void
119 }
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/align-spill-locations.ll ('k') | tests_lit/llvm2ice_tests/bitcast.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698