OLD | NEW |
1 ; This is a basic test of the alloca instruction. | 1 ; This is a basic test of the alloca instruction. |
2 | 2 |
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
4 ; RUN: --target x8632 -i %s --args -O2 \ | 4 ; RUN: --target x8632 -i %s --args -O2 \ |
5 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
6 | 6 |
7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
8 ; RUN: --target x8632 -i %s --args -Om1 \ | 8 ; RUN: --target x8632 -i %s --args -Om1 \ |
9 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 9 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 ; CHECK: add [[REG:.*]],0x1fffffff | 214 ; CHECK: add [[REG:.*]],0x1fffffff |
215 ; CHECK: and [[REG]],0xe0000000 | 215 ; CHECK: and [[REG]],0xe0000000 |
216 ; CHECK: sub esp,[[REG]] | 216 ; CHECK: sub esp,[[REG]] |
217 | 217 |
218 ; ARM32-LABEL: align512MB | 218 ; ARM32-LABEL: align512MB |
219 ; ARM32: and sp, sp, #-536870912 ; 0xe0000000 | 219 ; ARM32: and sp, sp, #-536870912 ; 0xe0000000 |
220 ; ARM32: mvn [[REG:.*]], #-536870912 ; 0xe0000000 | 220 ; ARM32: mvn [[REG:.*]], #-536870912 ; 0xe0000000 |
221 ; ARM32: add r0, r0, [[REG]] | 221 ; ARM32: add r0, r0, [[REG]] |
222 ; ARM32: and r0, r0, #-536870912 ; 0xe0000000 | 222 ; ARM32: and r0, r0, #-536870912 ; 0xe0000000 |
223 ; ARM32: sub sp, sp, r0 | 223 ; ARM32: sub sp, sp, r0 |
| 224 |
| 225 ; Test that a simple alloca sequence doesn't trigger a frame pointer. |
| 226 define void @fixed_no_frameptr(i32 %arg) { |
| 227 entry: |
| 228 %a1 = alloca i8, i32 8, align 4 |
| 229 %a2 = alloca i8, i32 12, align 4 |
| 230 %a3 = alloca i8, i32 16, align 4 |
| 231 %p1 = bitcast i8* %a1 to i32* |
| 232 %p2 = bitcast i8* %a2 to i32* |
| 233 %p3 = bitcast i8* %a3 to i32* |
| 234 store i32 %arg, i32* %p1, align 1 |
| 235 store i32 %arg, i32* %p2, align 1 |
| 236 store i32 %arg, i32* %p3, align 1 |
| 237 ret void |
| 238 } |
| 239 ; CHECK-LABEL: fixed_no_frameptr |
| 240 ; CHECK-NOT: mov ebp,esp |
| 241 |
| 242 ; Test that a more complex alloca sequence does trigger a frame pointer. |
| 243 define void @var_with_frameptr(i32 %arg) { |
| 244 entry: |
| 245 %a1 = alloca i8, i32 8, align 4 |
| 246 %a2 = alloca i8, i32 12, align 4 |
| 247 %a3 = alloca i8, i32 %arg, align 4 |
| 248 %p1 = bitcast i8* %a1 to i32* |
| 249 %p2 = bitcast i8* %a2 to i32* |
| 250 %p3 = bitcast i8* %a3 to i32* |
| 251 store i32 %arg, i32* %p1, align 1 |
| 252 store i32 %arg, i32* %p2, align 1 |
| 253 store i32 %arg, i32* %p3, align 1 |
| 254 ret void |
| 255 } |
| 256 ; CHECK-LABEL: var_with_frameptr |
| 257 ; CHECK: mov ebp,esp |
OLD | NEW |