brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 6192dfa Raw
87 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o4# RUN: link_fdata %s %t.o %t.fdata5# RUN: llvm-strip --strip-unneeded %t.o6# RUN: ld.lld --pie %t.o -o %t.exe -q7# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --split-functions --split-eh \8# RUN:   --split-all-cold --print-after-lowering  --print-only=_start 2>&1 \9# RUN:   | FileCheck %s10 11## _start has two landing pads: one hot and one cold. Hence, BOLT will introduce12## a landing pad trampoline. However, the trampoline code will make the main13## split fragment larger than the whole function before split. Then BOLT will14## undo the splitting and remove the trampoline.15 16# CHECK: Binary Function "_start"17# CHECK: IsSplit :18# CHECK-SAME: 019 20## Check that a landing pad trampoline was created, but contains no instructions21## and falls though to the real landing pad.22 23# CHECK: {{^[^[:space:]]+}} (0 instructions24# CHECK-NEXT: Landing Pad{{$}}25# CHECK: Exec Count26# CHECK-SAME: : 027# CHECK: Successors:28# CHECK-SAME: [[LP:[^[:space:]]+]]29# CHECK-EMPTY:30# CHECK-NEXT: [[LP]]31 32  .text33	.global foo34  .type foo, %function35foo:36  .cfi_startproc37  ret38  .cfi_endproc39  .size foo, .-foo40 41  .globl _start42  .type _start, %function43_start:44# FDATA: 0 [unknown] 0 1 _start 0 1 10045.Lfunc_begin0:46  .cfi_startproc47	.cfi_lsda 27, .Lexception048	call foo49.Ltmp0:50	call foo51.Ltmp1:52  ret53 54## Cold landing pad.55.LLP1:56  ret57 58## Hot landing pad.59LLP0:60# FDATA: 0 [unknown] 0 1 _start #LLP0# 1 10061	ret62 63  .cfi_endproc64.Lfunc_end0:65  .size _start, .-_start66 67## EH table.68	.section	.gcc_except_table,"a",@progbits69	.p2align	270GCC_except_table0:71.Lexception0:72	.byte	255                             # @LPStart Encoding = omit73	.byte	255                             # @TType Encoding = omit74	.byte	1                               # Call site Encoding = uleb12875	.uleb128 .Lcst_end0-.Lcst_begin076.Lcst_begin0:77	.uleb128 .Lfunc_begin0-.Lfunc_begin0  # >> Call Site 1 <<78	.uleb128 .Ltmp0-.Lfunc_begin0         #   Call between .Lfunc_begin0 and .Ltmp079	.uleb128 LLP0-.Lfunc_begin0					#   jumps to LLP080	.byte	0                               #   On action: cleanup81	.uleb128 .Ltmp0-.Lfunc_begin0         # >> Call Site 2 <<82	.uleb128 .Ltmp1-.Ltmp0                #   Call between .Ltmp0 and .Ltmp183	.uleb128 .LLP1-.Lfunc_begin0          #     jumps to .LLP184	.byte	0                               #   On action: cleanup85.Lcst_end0:86 87