OLD | NEW |
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: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
6 ; RUN: --target x8632 -i %s --args -O2 \ | 6 ; RUN: --target x8632 -i %s --args -O2 \ |
7 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 7 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
8 ; RUN: %if --need=allow_dump --need=target_X8632 --command %p2i --filetype=asm \ | 8 ; RUN: %if --need=allow_dump --need=target_X8632 --command %p2i --filetype=asm \ |
9 ; RUN: --assemble --disassemble -i %s --args -O2 \ | 9 ; RUN: --assemble --disassemble -i %s --args -O2 \ |
10 ; RUN: | %if --need=allow_dump --need=target_X8632 --command FileCheck %s | 10 ; RUN: | %if --need=allow_dump --need=target_X8632 --command FileCheck %s |
(...skipping 17 matching lines...) Expand all Loading... |
28 ; RUN: --command %p2i --filetype=obj \ | 28 ; RUN: --command %p2i --filetype=obj \ |
29 ; RUN: --disassemble --target arm32 -i %s --args -O2 \ | 29 ; RUN: --disassemble --target arm32 -i %s --args -O2 \ |
30 ; RUN: | %if --need=target_ARM32 \ | 30 ; RUN: | %if --need=target_ARM32 \ |
31 ; RUN: --command FileCheck --check-prefix ARM32 %s | 31 ; RUN: --command FileCheck --check-prefix ARM32 %s |
32 ; RUN: %if --need=target_ARM32 \ | 32 ; RUN: %if --need=target_ARM32 \ |
33 ; RUN: --command %p2i --filetype=obj \ | 33 ; RUN: --command %p2i --filetype=obj \ |
34 ; RUN: --disassemble --target arm32 -i %s --args -Om1 \ | 34 ; RUN: --disassemble --target arm32 -i %s --args -Om1 \ |
35 ; RUN: | %if --need=target_ARM32_dump \ | 35 ; RUN: | %if --need=target_ARM32_dump \ |
36 ; RUN: --command FileCheck --check-prefix ARM32 %s | 36 ; RUN: --command FileCheck --check-prefix ARM32 %s |
37 | 37 |
| 38 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ |
| 39 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target \ |
| 40 ; RUN: mips32 -i %s --args -O2 -allow-externally-defined-symbols \ |
| 41 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ |
| 42 ; RUN: --command FileCheck --check-prefix MIPS32 %s |
| 43 |
38 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 44 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
39 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 45 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
40 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 | 46 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 |
41 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 | 47 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 |
42 | 48 |
43 define internal void @CallIndirect(i32 %f) { | 49 define internal void @CallIndirect(i32 %f) { |
44 entry: | 50 entry: |
45 %__1 = inttoptr i32 %f to void ()* | 51 %__1 = inttoptr i32 %f to void ()* |
46 call void %__1() | 52 call void %__1() |
47 call void %__1() | 53 call void %__1() |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 ; X8664-OPTM1: mov e[[REG:..]],DWORD PTR | 97 ; X8664-OPTM1: mov e[[REG:..]],DWORD PTR |
92 ; X8664-OPTM1: call r[[REG]] | 98 ; X8664-OPTM1: call r[[REG]] |
93 ; | 99 ; |
94 ; ARM32-LABEL: CallIndirect | 100 ; ARM32-LABEL: CallIndirect |
95 ; ARM32: blx [[REGISTER:r.*]] | 101 ; ARM32: blx [[REGISTER:r.*]] |
96 ; ARM32: blx [[REGISTER]] | 102 ; ARM32: blx [[REGISTER]] |
97 ; ARM32: blx [[REGISTER]] | 103 ; ARM32: blx [[REGISTER]] |
98 ; ARM32: blx [[REGISTER]] | 104 ; ARM32: blx [[REGISTER]] |
99 ; ARM32: blx [[REGISTER]] | 105 ; ARM32: blx [[REGISTER]] |
100 | 106 |
| 107 ; MIPS32-LABEL: CallIndirect |
| 108 ; MIPS32: jalr [[REGISTER:.*]] |
| 109 ; MIPS32: jalr [[REGISTER]] |
| 110 ; MIPS32: jalr [[REGISTER]] |
| 111 ; MIPS32: jalr [[REGISTER]] |
101 | 112 |
102 @fp_v = internal global [4 x i8] zeroinitializer, align 4 | 113 @fp_v = internal global [4 x i8] zeroinitializer, align 4 |
103 | 114 |
104 define internal void @CallIndirectGlobal() { | 115 define internal void @CallIndirectGlobal() { |
105 entry: | 116 entry: |
106 %fp_ptr_i32 = bitcast [4 x i8]* @fp_v to i32* | 117 %fp_ptr_i32 = bitcast [4 x i8]* @fp_v to i32* |
107 %fp_ptr = load i32, i32* %fp_ptr_i32, align 1 | 118 %fp_ptr = load i32, i32* %fp_ptr_i32, align 1 |
108 %fp = inttoptr i32 %fp_ptr to void ()* | 119 %fp = inttoptr i32 %fp_ptr to void ()* |
109 call void %fp() | 120 call void %fp() |
110 call void %fp() | 121 call void %fp() |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 ; X8664-OPTM1: call r[[REG]] | 154 ; X8664-OPTM1: call r[[REG]] |
144 ; X8664-OPTM1: mov e[[REG:..]],DWORD PTR | 155 ; X8664-OPTM1: mov e[[REG:..]],DWORD PTR |
145 ; X8664-OPTM1: call r[[REG]] | 156 ; X8664-OPTM1: call r[[REG]] |
146 ; | 157 ; |
147 ; ARM32-LABEL: CallIndirectGlobal | 158 ; ARM32-LABEL: CallIndirectGlobal |
148 ; ARM32: blx {{r.*}} | 159 ; ARM32: blx {{r.*}} |
149 ; ARM32: blx [[REGISTER:r[0-9]*]] | 160 ; ARM32: blx [[REGISTER:r[0-9]*]] |
150 ; ARM32: blx [[REGISTER]] | 161 ; ARM32: blx [[REGISTER]] |
151 ; ARM32: blx [[REGISTER]] | 162 ; ARM32: blx [[REGISTER]] |
152 | 163 |
| 164 ; MIPS32-LABEL: CallIndirectGlobal |
| 165 ; MIPS32: jalr [[REGISTER:.*]] |
| 166 ; MIPS32: jalr [[REGISTER]] |
| 167 ; MIPS32: jalr [[REGISTER]] |
| 168 ; MIPS32: jalr [[REGISTER]] |
| 169 |
153 ; Calling an absolute address is used for non-IRT PNaCl pexes to directly | 170 ; Calling an absolute address is used for non-IRT PNaCl pexes to directly |
154 ; access syscall trampolines. This is not really an indirect call, but | 171 ; access syscall trampolines. This is not really an indirect call, but |
155 ; there is a cast from int to pointer first. | 172 ; there is a cast from int to pointer first. |
156 define internal void @CallConst() { | 173 define internal void @CallConst() { |
157 entry: | 174 entry: |
158 %__1 = inttoptr i32 66496 to void ()* | 175 %__1 = inttoptr i32 66496 to void ()* |
159 call void %__1() | 176 call void %__1() |
160 call void %__1() | 177 call void %__1() |
161 call void %__1() | 178 call void %__1() |
162 ret void | 179 ret void |
(...skipping 20 matching lines...) Expand all Loading... |
183 ; e8 00 00 00 00 call {{.*}} *ABS*+0x103bc | 200 ; e8 00 00 00 00 call {{.*}} *ABS*+0x103bc |
184 ; | 201 ; |
185 ; ARM32-LABEL: CallConst | 202 ; ARM32-LABEL: CallConst |
186 ; ARM32: movw [[REGISTER:r.*]], #960 | 203 ; ARM32: movw [[REGISTER:r.*]], #960 |
187 ; ARM32: movt [[REGISTER]], #1 | 204 ; ARM32: movt [[REGISTER]], #1 |
188 ; ARM32: blx [[REGISTER]] | 205 ; ARM32: blx [[REGISTER]] |
189 ; The legalization of the constant could be shared, but it isn't. | 206 ; The legalization of the constant could be shared, but it isn't. |
190 ; ARM32: movw [[REGISTER:r.*]], #960 | 207 ; ARM32: movw [[REGISTER:r.*]], #960 |
191 ; ARM32: blx [[REGISTER]] | 208 ; ARM32: blx [[REGISTER]] |
192 ; ARM32: blx [[REGISTER]] | 209 ; ARM32: blx [[REGISTER]] |
OLD | NEW |