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

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: 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
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
20 ; CHECK-NEXT: R_{{.*}} f1
22 21
23 define void @fixed_416_align_32(i32 %n) { 22 define void @fixed_416_align_32(i32 %n) {
24 entry: 23 entry:
25 %array = alloca i8, i32 400, align 32 24 %array = alloca i8, i32 400, align 32
26 %__2 = ptrtoint i8* %array to i32 25 %__2 = ptrtoint i8* %array to i32
27 call void @f1(i32 %__2) 26 call void @f1(i32 %__2)
28 ret void 27 ret void
29 } 28 }
30 ; CHECK-LABEL: fixed_416_align_32: 29 ; CHECK-LABEL: fixed_416_align_32
31 ; CHECK: and esp, -32 30 ; CHECK: and esp,0xffffffe0
32 ; CHECK: sub esp, 416 31 ; CHECK: sub esp,0x1a0
33 ; CHECK: sub esp, 16 32 ; CHECK: sub esp,0x10
34 ; CHECK: mov dword ptr [esp], eax 33 ; CHECK: mov DWORD PTR [esp],eax
35 ; CHECK: call f1 34 ; CHECK: call
35 ; CHECK-NEXT: R_{{.*}} f1
36 36
37 define void @fixed_351_align_16(i32 %n) { 37 define void @fixed_351_align_16(i32 %n) {
38 entry: 38 entry:
39 %array = alloca i8, i32 351, align 16 39 %array = alloca i8, i32 351, align 16
40 %__2 = ptrtoint i8* %array to i32 40 %__2 = ptrtoint i8* %array to i32
41 call void @f1(i32 %__2) 41 call void @f1(i32 %__2)
42 ret void 42 ret void
43 } 43 }
44 ; CHECK-LABEL: fixed_351_align_16: 44 ; CHECK-LABEL: fixed_351_align_16
45 ; CHECK: sub esp, 352 45 ; CHECK: sub esp,0x160
46 ; CHECK: sub esp, 16 46 ; CHECK: sub esp,0x10
47 ; CHECK: mov dword ptr [esp], eax 47 ; CHECK: mov DWORD PTR [esp],eax
48 ; CHECK: call f1 48 ; CHECK: call
49 ; CHECK-NEXT: R_{{.*}} f1
49 50
50 define void @fixed_351_align_32(i32 %n) { 51 define void @fixed_351_align_32(i32 %n) {
51 entry: 52 entry:
52 %array = alloca i8, i32 351, align 32 53 %array = alloca i8, i32 351, align 32
53 %__2 = ptrtoint i8* %array to i32 54 %__2 = ptrtoint i8* %array to i32
54 call void @f1(i32 %__2) 55 call void @f1(i32 %__2)
55 ret void 56 ret void
56 } 57 }
57 ; CHECK-LABEL: fixed_351_align_32: 58 ; CHECK-LABEL: fixed_351_align_32
58 ; CHECK: and esp, -32 59 ; CHECK: and esp,0xffffffe0
59 ; CHECK: sub esp, 352 60 ; CHECK: sub esp,0x160
60 ; CHECK: sub esp, 16 61 ; CHECK: sub esp,0x10
61 ; CHECK: mov dword ptr [esp], eax 62 ; CHECK: mov DWORD PTR [esp],eax
62 ; CHECK: call f1 63 ; CHECK: call
64 ; CHECK-NEXT: R_{{.*}} f1
63 65
64 define void @f1(i32 %ignored) { 66 declare void @f1(i32 %ignored)
65 entry:
66 ret void
67 }
68 67
69 define void @variable_n_align_16(i32 %n) { 68 define void @variable_n_align_16(i32 %n) {
70 entry: 69 entry:
71 %array = alloca i8, i32 %n, align 16 70 %array = alloca i8, i32 %n, align 16
72 %__2 = ptrtoint i8* %array to i32 71 %__2 = ptrtoint i8* %array to i32
73 call void @f2(i32 %__2) 72 call void @f2(i32 %__2)
74 ret void 73 ret void
75 } 74 }
76 ; CHECK-LABEL: variable_n_align_16: 75 ; CHECK-LABEL: variable_n_align_16
77 ; CHECK: mov eax, dword ptr [ebp + 8] 76 ; CHECK: mov eax,DWORD PTR [ebp+0x8]
78 ; CHECK: add eax, 15 77 ; CHECK: add eax,0xf
79 ; CHECK: and eax, -16 78 ; CHECK: and eax,0xfffffff0
80 ; CHECK: sub esp, eax 79 ; CHECK: sub esp,eax
81 ; CHECK: sub esp, 16 80 ; CHECK: sub esp,0x10
82 ; CHECK: mov dword ptr [esp], eax 81 ; CHECK: mov DWORD PTR [esp],eax
83 ; CHECK: call f2 82 ; CHECK: call
83 ; CHECK-NEXT: R_{{.*}} f2
84 84
85 define void @variable_n_align_32(i32 %n) { 85 define void @variable_n_align_32(i32 %n) {
86 entry: 86 entry:
87 %array = alloca i8, i32 %n, align 32 87 %array = alloca i8, i32 %n, align 32
88 %__2 = ptrtoint i8* %array to i32 88 %__2 = ptrtoint i8* %array to i32
89 call void @f2(i32 %__2) 89 call void @f2(i32 %__2)
90 ret void 90 ret void
91 } 91 }
92 ; In -O2, the order of the CHECK-DAG lines in the output is switched. 92 ; In -O2, the order of the CHECK-DAG lines in the output is switched.
93 ; CHECK-LABEL: variable_n_align_32: 93 ; CHECK-LABEL: variable_n_align_32
94 ; CHECK-DAG: and esp, -32 94 ; CHECK-DAG: and esp,0xffffffe0
95 ; CHECK-DAG: mov eax, dword ptr [ebp + 8] 95 ; CHECK-DAG: mov eax,DWORD PTR [ebp+0x8]
96 ; CHECK: add eax, 31 96 ; CHECK: add eax,0x1f
97 ; CHECK: and eax, -32 97 ; CHECK: and eax,0xffffffe0
98 ; CHECK: sub esp, eax 98 ; CHECK: sub esp,eax
99 ; CHECK: sub esp, 16 99 ; CHECK: sub esp,0x10
100 ; CHECK: mov dword ptr [esp], eax 100 ; CHECK: mov DWORD PTR [esp],eax
101 ; CHECK: call f2 101 ; CHECK: call
102 ; CHECK-NEXT: R_{{.*}} f2
102 103
103 ; Test alloca with default (0) alignment. 104 ; Test alloca with default (0) alignment.
104 define void @align0(i32 %n) { 105 define void @align0(i32 %n) {
105 entry: 106 entry:
106 %array = alloca i8, i32 %n 107 %array = alloca i8, i32 %n
107 %__2 = ptrtoint i8* %array to i32 108 %__2 = ptrtoint i8* %array to i32
108 call void @f2(i32 %__2) 109 call void @f2(i32 %__2)
109 ret void 110 ret void
110 } 111 }
111 ; CHECK-LABEL: align0 112 ; CHECK-LABEL: align0
112 ; CHECK: add [[REG:.*]], 15 113 ; CHECK: add [[REG:.*]],0xf
113 ; CHECK: and [[REG]], -16 114 ; CHECK: and [[REG]],0xfffffff0
114 ; CHECK: sub esp, [[REG]] 115 ; CHECK: sub esp,[[REG]]
115 116
116 define void @f2(i32 %ignored) { 117 declare void @f2(i32 %ignored)
117 entry:
118 ret void
119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698