66 lines · plain
1## This checks that shrink wrapping correctly drops moving push/pops when2## there is an LEA instruction.3 4 5# REQUIRES: system-linux6 7# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \8# RUN: %s -o %t.o9# RUN: link_fdata %s %t.o %t.fdata10# RUN: llvm-strip --strip-unneeded %t.o11# RUN: ld.lld %t.o -o %t.exe -q12# RUN: llvm-bolt %t.exe -relocs -o %t.out -data %t.fdata \13# RUN: -frame-opt=all -simplify-conditional-tail-calls=false \14# RUN: -experimental-shrink-wrapping \15# RUN: -eliminate-unreachable=false | FileCheck %s16# RUN: llvm-objdump -d %t.out --print-imm-hex | \17# RUN: FileCheck --check-prefix CHECK-OBJDUMP %s18 19 .globl _start20 .type _start, %function21_start:22 .cfi_startproc23# FDATA: 0 [unknown] 0 1 _start 0 0 124 push %rbp25 mov %rsp, %rbp26 push %rbx27 push %r1428 subq $0x20, %rsp29 je b30c:31 addq $0x20, %rsp32 pop %r1433 pop %rbx34 pop %rbp35 ret36b:37 je f38 jmp *JT(,%rdi,8)39d:40 mov %r14, %rdi41 mov %rbx, %rdi42 leaq -0x20(%rbp), %r1443 movq -0x20(%rbp), %rdi44f:45 addq $0x20, %rsp46 pop %r1447 pop %rbx48 pop %rbp49 ret50 .cfi_endproc51 .size _start, .-_start52 .data53JT:54 .quad c55 .quad d56 .quad f57 58 59# CHECK: BOLT-INFO: Shrink wrapping moved 2 spills inserting load/stores and 0 spills inserting push/pops60 61## Checks that offsets of instructions accessing the stack were not changed62# CHECK-OBJDUMP: <_start>:63# CHECK-OBJDUMP: movq %rbx, %rdi64# CHECK-OBJDUMP-NEXT: leaq -0x20(%rbp), %r1465# CHECK-OBJDUMP: movq -0x20(%rbp), %rdi66