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: %llvm2ice -O2 --verbose none %s \ | 3 ; RUN: %llvm2ice -O2 --verbose none %s \ |
4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
6 ; RUN: %llvm2ice -Om1 --verbose none %s \ | 6 ; RUN: %llvm2ice -Om1 --verbose none %s \ |
7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
9 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 9 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
10 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 10 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ; CHECK-LABEL: variable_n_align_32: | 97 ; CHECK-LABEL: variable_n_align_32: |
98 ; CHECK-DAG: and esp, -32 | 98 ; CHECK-DAG: and esp, -32 |
99 ; CHECK-DAG: mov eax, dword ptr [ebp + 8] | 99 ; CHECK-DAG: mov eax, dword ptr [ebp + 8] |
100 ; CHECK: add eax, 31 | 100 ; CHECK: add eax, 31 |
101 ; CHECK: and eax, -32 | 101 ; CHECK: and eax, -32 |
102 ; CHECK: sub esp, eax | 102 ; CHECK: sub esp, eax |
103 ; CHECK: sub esp, 16 | 103 ; CHECK: sub esp, 16 |
104 ; CHECK: mov dword ptr [esp], eax | 104 ; CHECK: mov dword ptr [esp], eax |
105 ; CHECK: call f2 | 105 ; CHECK: call f2 |
106 | 106 |
| 107 ; Test alloca with default (0) alignment. |
| 108 define void @align0(i32 %n) { |
| 109 entry: |
| 110 %array = alloca i8, i32 %n |
| 111 %__2 = ptrtoint i8* %array to i32 |
| 112 call void @f2(i32 %__2) |
| 113 ret void |
| 114 } |
| 115 ; CHECK-LABEL: align0 |
| 116 ; CHECK: add [[REG:.*]], 15 |
| 117 ; CHECK: and [[REG]], -16 |
| 118 ; CHECK: sub esp, [[REG]] |
| 119 |
107 define void @f2(i32 %ignored) { | 120 define void @f2(i32 %ignored) { |
108 entry: | 121 entry: |
109 ret void | 122 ret void |
110 } | 123 } |
111 | 124 |
112 ; ERRORS-NOT: ICE translation error | 125 ; ERRORS-NOT: ICE translation error |
113 ; DUMP-NOT: SZ | 126 ; DUMP-NOT: SZ |
OLD | NEW |