brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 3939b5c Raw
50 lines · plain
1## Check unreachable code elimination2 3RUN: %clang %cflags %p/../Inputs/stub.c -fPIC -pie -shared -o %t.so4RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \5RUN:   %p/Inputs/unreachable.s -o %t.o6RUN: %clangxx %cxxflags -no-pie %t.o -o %t.exe %t.so7RUN: llvm-bolt %t.exe -o %t \8RUN:   -reorder-blocks=none -split-functions -eliminate-unreachable \9RUN:   -funcs=foo -use-gnu-stack -print-cfg -print-finalized \10RUN:   | FileCheck %s --check-prefix=BOLT11RUN: llvm-objdump -d %t --print-imm-hex --disassemble-symbols=foo \12RUN:   --no-show-raw-insn | FileCheck %s13 14BOLT: BB Layout   : .LBB{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LLP{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}15BOLT: BOLT-INFO: UCE removed 4 blocks and 16 bytes of code16BOLT: BB Layout   : .LBB{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LLP{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}17 18CHECK: <foo>:19CHECK-NEXT: pushq   %rbp20CHECK-NEXT: movq    %rsp, %rbp21CHECK-NEXT: pushq   %rbx22CHECK-NEXT: subq    $0x18, %rsp23CHECK-NEXT: movq    %rdi, -0x18(%rbp)24CHECK-NEXT: incq   -0x18(%rbp)25CHECK-NEXT: incq   -0x18(%rbp)26CHECK-NEXT: cmpq   $0x2, -0x18(%rbp)27CHECK-NEXT: je    0x[[#%x,JMP1:]]28CHECK-NEXT: incq   -0x18(%rbp)29CHECK-NEXT: [[#JMP1]]: incq   -0x18(%rbp)30CHECK-NEXT: movq    -0x18(%rbp), %rax31CHECK-NEXT: movq    %rax, %rdi32CHECK-NEXT: callq {{.*}} <bar>33CHECK-NEXT: movq    %rax, %rbx34CHECK-NEXT: [[#%x,JMP3:]]: movq    %rbx, %rax35CHECK-NEXT: jmp   {{.*}}36CHECK-NEXT: movq    %rax, %rdi37CHECK-NEXT: callq {{.*}} <__cxa_begin_catch@plt>38CHECK-NEXT: incq   -0x18(%rbp)39CHECK-NEXT: incq   -0x18(%rbp)40CHECK-NEXT: cmpq   $0x2, -0x18(%rbp)41CHECK-NEXT: je    0x[[#%x,JMP2:]]42CHECK-NEXT: incq   -0x18(%rbp)43CHECK-NEXT: [[#JMP2]]: incq   -0x18(%rbp)44CHECK-NEXT: movq    -0x18(%rbp), %rbx45CHECK-NEXT: callq {{.*}} <__cxa_end_catch@plt>46CHECK-NEXT: jmp   0x[[#JMP3]]47CHECK-NEXT: movq	-0x8(%rbp), %rbx48CHECK-NEXT: leave49CHECK-NEXT: retq50