| ; This is a basic test of the alloca instruction - one test for alloca |
| ; of a fixed size, and one test for variable size. |
| ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s |
| ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck --check-prefix=OPTM1 %s |
| ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
| ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
| ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
| ; RUN: | FileCheck --check-prefix=DUMP %s |
| define void @fixed_400(i32 %n) { |
| %array = alloca i8, i32 400, align 16 |
| %__2 = ptrtoint i8* %array to i32 |
| ; CHECK-NEXT: mov eax, esp |
| ; OPTM1-NEXT: mov {{.*}}, esp |
| define void @variable_n(i32 %n) { |
| %array = alloca i8, i32 %n, align 16 |
| %__2 = ptrtoint i8* %array to i32 |
| ; CHECK: mov eax, dword ptr [ebp+8] |
| ; CHECK-NEXT: sub esp, eax |
| ; CHECK-NEXT: mov eax, esp |
| ; ERRORS-NOT: ICE translation error |