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

Side by Side Diff: tests_lit/llvm2ice_tests/callindirect.pnacl.ll

Issue 1187513006: ARM: Assign "actuals" at call site to the appropriate GPR/stack slot. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: review Created 5 years, 6 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/64bit.pnacl.ll ('k') | tests_lit/llvm2ice_tests/globalinit.pnacl.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 ; Test of multiple indirect calls to the same target. Each call 1 ; Test of multiple indirect calls to the same target. Each call
2 ; should be to the same operand, whether it's in a register or on the 2 ; should be to the same operand, whether it's in a register or on the
3 ; stack. 3 ; stack.
4 4
5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ 5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
6 ; RUN: | FileCheck %s 6 ; RUN: --target x8632 -i %s --args -O2 \
7 ; RUN: %if --need=allow_dump --command %p2i --filetype=asm --assemble \ 7 ; RUN: | %if --need=target_X8632 --command FileCheck %s
8 ; RUN: --disassemble -i %s --args -O2 \ 8 ; RUN: %if --need=allow_dump --need=target_X8632 --command %p2i --filetype=asm \
9 ; RUN: | %if --need=allow_dump --command FileCheck %s 9 ; RUN: --assemble --disassemble -i %s --args -O2 \
10 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 \ 10 ; RUN: | %if --need=allow_dump --need=target_X8632 --command FileCheck %s
11 ; RUN: | FileCheck --check-prefix=OPTM1 %s 11 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
12 ; RUN: --target x8632 -i %s --args -Om1 \
13 ; RUN: | %if --need=target_X8632 --command FileCheck --check-prefix=OPTM1 %s
14
15 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented)
16 ; once enough infrastructure is in. Also, switch to --filetype=obj
17 ; when possible.
18 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --assemble \
19 ; RUN: --disassemble --target arm32 -i %s --args -O2 --skip-unimplemented \
20 ; RUN: | %if --need=target_ARM32 --command FileCheck --check-prefix ARM32 %s
12 21
13 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 22 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
14 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 23 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
15 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 24 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8
16 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 25 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4
17 26
18 define internal void @CallIndirect(i32 %f) { 27 define internal void @CallIndirect(i32 %f) {
19 entry: 28 entry:
20 %__1 = inttoptr i32 %f to void ()* 29 %__1 = inttoptr i32 %f to void ()*
21 call void %__1() 30 call void %__1()
22 call void %__1() 31 call void %__1()
23 call void %__1() 32 call void %__1()
24 call void %__1() 33 call void %__1()
25 call void %__1() 34 call void %__1()
26 ret void 35 ret void
27 } 36 }
28 ; CHECK-LABEL: CallIndirect 37 ; CHECK-LABEL: CallIndirect
29 ; CHECK: call [[REGISTER:[a-z]+]] 38 ; CHECK: call [[REGISTER:[a-z]+]]
30 ; CHECK: call [[REGISTER]] 39 ; CHECK: call [[REGISTER]]
31 ; CHECK: call [[REGISTER]] 40 ; CHECK: call [[REGISTER]]
32 ; CHECK: call [[REGISTER]] 41 ; CHECK: call [[REGISTER]]
33 ; CHECK: call [[REGISTER]] 42 ; CHECK: call [[REGISTER]]
34 ; 43 ;
35 ; OPTM1-LABEL: CallIndirect 44 ; OPTM1-LABEL: CallIndirect
36 ; OPTM1: call [[TARGET:.+]] 45 ; OPTM1: call [[TARGET:.+]]
37 ; OPTM1: call [[TARGET]] 46 ; OPTM1: call [[TARGET]]
38 ; OPTM1: call [[TARGET]] 47 ; OPTM1: call [[TARGET]]
39 ; OPTM1: call [[TARGET]] 48 ; OPTM1: call [[TARGET]]
40 ; OPTM1: call [[TARGET]] 49 ; OPTM1: call [[TARGET]]
50 ;
51 ; ARM32-LABEL: CallIndirect
52 ; ARM32: blx [[REGISTER:r.*]]
53 ; ARM32: blx [[REGISTER]]
54 ; ARM32: blx [[REGISTER]]
55 ; ARM32: blx [[REGISTER]]
56 ; ARM32: blx [[REGISTER]]
57
41 58
42 @fp_v = internal global [4 x i8] zeroinitializer, align 4 59 @fp_v = internal global [4 x i8] zeroinitializer, align 4
43 60
44 define internal void @CallIndirectGlobal() { 61 define internal void @CallIndirectGlobal() {
45 entry: 62 entry:
46 %fp_ptr_i32 = bitcast [4 x i8]* @fp_v to i32* 63 %fp_ptr_i32 = bitcast [4 x i8]* @fp_v to i32*
47 %fp_ptr = load i32, i32* %fp_ptr_i32, align 1 64 %fp_ptr = load i32, i32* %fp_ptr_i32, align 1
48 %fp = inttoptr i32 %fp_ptr to void ()* 65 %fp = inttoptr i32 %fp_ptr to void ()*
49 call void %fp() 66 call void %fp()
50 call void %fp() 67 call void %fp()
51 call void %fp() 68 call void %fp()
52 call void %fp() 69 call void %fp()
53 ret void 70 ret void
54 } 71 }
55 ; CHECK-LABEL: CallIndirectGlobal 72 ; CHECK-LABEL: CallIndirectGlobal
56 ; CHECK: call [[REGISTER:[a-z]+]] 73 ; CHECK: call [[REGISTER:[a-z]+]]
57 ; CHECK: call [[REGISTER]] 74 ; CHECK: call [[REGISTER]]
58 ; CHECK: call [[REGISTER]] 75 ; CHECK: call [[REGISTER]]
59 ; CHECK: call [[REGISTER]] 76 ; CHECK: call [[REGISTER]]
60 ; 77 ;
61 ; OPTM1-LABEL: CallIndirectGlobal 78 ; OPTM1-LABEL: CallIndirectGlobal
62 ; OPTM1: call [[TARGET:.+]] 79 ; OPTM1: call [[TARGET:.+]]
63 ; OPTM1: call [[TARGET]] 80 ; OPTM1: call [[TARGET]]
64 ; OPTM1: call [[TARGET]] 81 ; OPTM1: call [[TARGET]]
65 ; OPTM1: call [[TARGET]] 82 ; OPTM1: call [[TARGET]]
83 ;
84 ; ARM32-LABEL: CallIndirectGlobal
85 ; ARM32: blx [[REGISTER:r.*]]
86 ; ARM32: blx [[REGISTER]]
87 ; ARM32: blx [[REGISTER]]
88 ; ARM32: blx [[REGISTER]]
66 89
67 ; Calling an absolute address is used for non-IRT PNaCl pexes to directly 90 ; Calling an absolute address is used for non-IRT PNaCl pexes to directly
68 ; access syscall trampolines. This is not really an indirect call, but 91 ; access syscall trampolines. This is not really an indirect call, but
69 ; there is a cast from int to pointer first. 92 ; there is a cast from int to pointer first.
70 define internal void @CallConst() { 93 define internal void @CallConst() {
71 entry: 94 entry:
72 %__1 = inttoptr i32 66496 to void ()* 95 %__1 = inttoptr i32 66496 to void ()*
73 call void %__1() 96 call void %__1()
74 call void %__1() 97 call void %__1()
75 call void %__1() 98 call void %__1()
76 ret void 99 ret void
77 } 100 }
78 101
79 ; CHECK-LABEL: CallConst 102 ; CHECK-LABEL: CallConst
80 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* 103 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS*
81 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* 104 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS*
82 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* 105 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS*
83 ; 106 ;
84 ; OPTM1-LABEL: CallConst 107 ; OPTM1-LABEL: CallConst
85 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* 108 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS*
86 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* 109 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS*
87 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* 110 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS*
111 ;
112 ; ARM32-LABEL: CallConst
113 ; ARM32: movw [[REGISTER:r.*]], #960
114 ; ARM32: movt [[REGISTER]], #1
115 ; ARM32: blx [[REGISTER]]
116 ; The legalization of the constant could be shared, but it isn't.
117 ; ARM32: movw [[REGISTER:r.*]], #960
118 ; ARM32: blx [[REGISTER]]
119 ; ARM32: blx [[REGISTER]]
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/64bit.pnacl.ll ('k') | tests_lit/llvm2ice_tests/globalinit.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698