| OLD | NEW |
| 1 ; This test originally exhibited a bug in ebp-based stack slots. The | 1 ; This test originally exhibited a bug in ebp-based stack slots. The |
| 2 ; problem was that during a function call push sequence, the esp | 2 ; problem was that during a function call push sequence, the esp |
| 3 ; adjustment was incorrectly added to the stack/frame offset for | 3 ; adjustment was incorrectly added to the stack/frame offset for |
| 4 ; ebp-based frames. | 4 ; ebp-based frames. |
| 5 | 5 |
| 6 ; TODO(kschimpf) Find out why lc2i is needed. | 6 ; TODO(kschimpf) Find out why lc2i is needed. |
| 7 ; REQUIRES: allow_llvm_ir_as_input | 7 ; REQUIRES: allow_llvm_ir_as_input |
| 8 ; RUN: %lc2i -i %s --args -Om1 --target=x8632 --verbose none \ | 8 ; RUN: %lc2i -i %s --args -Om1 --target=x8632 --verbose none \ |
| 9 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 9 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ |
| 10 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 10 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
| 11 | 11 |
| 12 declare i32 @memcpy_helper2(i32 %buf, i32 %buf2, i32 %n) | 12 declare i32 @memcpy_helper2(i32 %buf, i32 %buf2, i32 %n) |
| 13 | 13 |
| 14 define i32 @memcpy_helper(i32 %buf, i32 %n) { | 14 define i32 @memcpy_helper(i32 %buf, i32 %n) { |
| 15 entry: | 15 entry: |
| 16 %n.arg_trunc = trunc i32 %n to i8 | 16 %n.arg_trunc = trunc i32 %n to i8 |
| 17 %buf2 = alloca i8, i32 128, align 4 | 17 %buf2 = alloca i8, i32 128, align 4 |
| 18 %buf2.asint = ptrtoint i8* %buf2 to i32 | 18 %buf2.asint = ptrtoint i8* %buf2 to i32 |
| 19 %arg_ext = zext i8 %n.arg_trunc to i32 | 19 %arg_ext = zext i8 %n.arg_trunc to i32 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 ; CHECK: movzx eax, byte ptr [ebp - 4] | 38 ; CHECK: movzx eax, byte ptr [ebp - 4] |
| 39 ; CHECK: mov dword ptr [ebp - 16], eax | 39 ; CHECK: mov dword ptr [ebp - 16], eax |
| 40 ; CHECK: sub esp, 16 | 40 ; CHECK: sub esp, 16 |
| 41 ; CHECK: mov ecx, dword ptr [ebp + 8] | 41 ; CHECK: mov ecx, dword ptr [ebp + 8] |
| 42 ; CHECK: mov dword ptr [esp], ecx | 42 ; CHECK: mov dword ptr [esp], ecx |
| 43 ; CHECK: mov ecx, dword ptr [ebp - 12] | 43 ; CHECK: mov ecx, dword ptr [ebp - 12] |
| 44 ; CHECK: mov dword ptr [esp + 4], ecx | 44 ; CHECK: mov dword ptr [esp + 4], ecx |
| 45 ; CHECK: mov ecx, dword ptr [ebp - 16] | 45 ; CHECK: mov ecx, dword ptr [ebp - 16] |
| 46 ; CHECK: mov dword ptr [esp + 8], ecx | 46 ; CHECK: mov dword ptr [esp + 8], ecx |
| 47 ; CHECK: call -4 | 47 ; CHECK: call -4 |
| OLD | NEW |