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

Side by Side Diff: tests_lit/llvm2ice_tests/fused-alloca-arg.ll

Issue 1411583007: Combine allocas (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix a typo. Created 5 years, 1 month 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 ; This is a basic test of the alloca instruction and a call.
2
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
4 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \
5 ; RUN: | %if --need=target_X8632 --command FileCheck %s
6
7 declare void @copy(i32 %arg1, i8* %arr1, i8* %arr2, i8* %arr3, i8* %arr4);
8
9 ; Test that alloca base addresses get passed correctly to functions.
10 define internal void @caller1(i32 %arg) {
11 entry:
12 %a1 = alloca i8, i32 32, align 4
13 %p1 = bitcast i8* %a1 to i32*
14 store i32 %arg, i32* %p1, align 1
15 call void @copy(i32 %arg, i8* %a1, i8* %a1, i8* %a1, i8* %a1)
16 ret void
17 }
18
19 ; CHECK-LABEL: caller1
20 ; CHECK-NEXT: sub esp,0xc
21 ; CHECK-NEXT: mov eax,DWORD PTR [esp+0x10]
22 ; CHECK-NEXT: sub esp,0x20
23 ; CHECK-NEXT: mov ecx,esp
24 ; CHECK-NEXT: mov DWORD PTR [esp],eax
25 ; CHECK-NEXT: sub esp,0x20
26 ; CHECK-NEXT: mov DWORD PTR [esp],eax
27 ; CHECK-NEXT: lea eax,[esp+0x20]
28 ; CHECK-NEXT: mov DWORD PTR [esp+0x4],eax
29 ; CHECK-NEXT: lea eax,[esp+0x20]
30 ; CHECK-NEXT: mov DWORD PTR [esp+0x8],eax
31 ; CHECK-NEXT: lea eax,[esp+0x20]
32 ; CHECK-NEXT: mov DWORD PTR [esp+0xc],eax
33 ; CHECK-NEXT: lea eax,[esp+0x20]
34 ; CHECK-NEXT: mov DWORD PTR [esp+0x10],eax
35 ; CHECK-NEXT: call
36 ; CHECK-NEXT: add esp,0x20
37 ; CHECK-NEXT: add esp,0x2c
38 ; CHECK-NEXT: ret
39
40 ; Test that alloca base addresses get passed correctly to functions.
41 define internal void @caller2(i32 %arg) {
42 entry:
43 %a1 = alloca i8, i32 32, align 4
44 %a2 = alloca i8, i32 32, align 4
45 %p1 = bitcast i8* %a1 to i32*
46 %p2 = bitcast i8* %a2 to i32*
47 store i32 %arg, i32* %p1, align 1
48 store i32 %arg, i32* %p2, align 1
49 call void @copy(i32 %arg, i8* %a1, i8* %a2, i8* %a1, i8* %a2)
50 ret void
51 }
52
53 ; CHECK-LABEL: caller2
54 ; CHECK-NEXT: sub esp,0xc
55 ; CHECK-NEXT: mov eax,DWORD PTR [esp+0x10]
56 ; CHECK-NEXT: sub esp,0x40
57 ; CHECK-NEXT: mov ecx,esp
58 ; CHECK-NEXT: mov DWORD PTR [esp],eax
59 ; CHECK-NEXT: mov DWORD PTR [esp+0x20],eax
60 ; CHECK-NEXT: sub esp,0x20
61 ; CHECK-NEXT: mov DWORD PTR [esp],eax
62 ; CHECK-NEXT: lea eax,[esp+0x20]
63 ; CHECK-NEXT: mov DWORD PTR [esp+0x4],eax
64 ; CHECK-NEXT: lea eax,[esp+0x40]
65 ; CHECK-NEXT: mov DWORD PTR [esp+0x8],eax
66 ; CHECK-NEXT: lea eax,[esp+0x20]
67 ; CHECK-NEXT: mov DWORD PTR [esp+0xc],eax
68 ; CHECK-NEXT: lea eax,[esp+0x40]
69 ; CHECK-NEXT: mov DWORD PTR [esp+0x10],eax
70 ; CHECK-NEXT: call
71 ; CHECK-NEXT: add esp,0x20
72 ; CHECK-NEXT: add esp,0x4c
73 ; CHECK-NEXT: ret
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698