1 ## Test BinaryContext::calculateEmittedSize's functionality to update
2 ## BinaryBasicBlock::OutputAddressRange in place so that the emitted size
3 ## of each basic block is given by BinaryBasicBlock::getOutputSize()
5 # RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
6 # RUN: link_fdata %s %t.o %t.fdata
7 # RUN: llvm-strip --strip-unneeded %t.o
8 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
9 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=all \
10 # RUN: --print-split --print-only=chain --print-output-address-range \
11 # RUN: --data=%t.fdata --reorder-blocks=ext-tsp \
12 # RUN: 2>&1 | FileCheck --check-prefix=SPLITALL %s
13 # RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
14 # RUN: link_fdata %s %t.o %t.fdata
15 # RUN: llvm-strip --strip-unneeded %t.o
16 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
17 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --print-split \
18 # RUN: --print-only=chain --print-output-address-range \
19 # RUN: --data=%t.fdata --reorder-blocks=ext-tsp \
20 # RUN: 2>&1 | FileCheck --check-prefix=SPLITHOTCOLD %s
22 # SPLITALL: {{^\.LBB00}}
23 # SPLITALL: Output Address Range: [0x0, 0x12) (18 bytes)
24 # SPLITALL: {{^\.LFT0}}
25 # SPLITALL: Output Address Range: [0x0, 0xa) (10 bytes)
26 # SPLITALL: {{^\.Ltmp1}}
27 # SPLITALL: Output Address Range: [0x0, 0x2) (2 bytes)
28 # SPLITALL: {{^\.Ltmp0}}
29 # SPLITALL: Output Address Range: [0x0, 0x10) (16 bytes)
30 # SPLITALL: {{^\.Ltmp2}}
31 # SPLITALL: Output Address Range: [0x0, 0x8) (8 bytes)
32 # SPLITALL: {{^\.LFT1}}
33 # SPLITALL: Output Address Range: [0x0, 0x8) (8 bytes)
35 # SPLITHOTCOLD: {{^\.LBB00}}
36 # SPLITHOTCOLD: Output Address Range: [0x0, 0x9) (9 bytes)
37 # SPLITHOTCOLD: {{^\.LFT0}}
38 # SPLITHOTCOLD: Output Address Range: [0x9, 0xe) (5 bytes)
39 # SPLITHOTCOLD: {{^\.Ltmp1}}
40 # SPLITHOTCOLD: Output Address Range: [0xe, 0x10) (2 bytes)
41 # SPLITHOTCOLD: {{^\.Ltmp0}}
42 # SPLITHOTCOLD: Output Address Range: [0x10, 0x1b) (11 bytes)
43 # SPLITHOTCOLD: {{^\.Ltmp2}}
44 # SPLITHOTCOLD: Output Address Range: [0x1b, 0x20) (5 bytes)
45 # SPLITHOTCOLD: {{^\.LFT1}}
46 # SPLITHOTCOLD: Output Address Range: [0x0, 0x8) (8 bytes)
50 .type chain, @function
55 LLentry_LLchain_start
:
57 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLchain_start# 0 10
58 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLfast# 0 500
63 # FDATA: 1 chain #LLfast_LLexit# 1 chain #LLexit# 0 500
66 LLchain_start_LLchain1
:
68 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLchain1# 0 10
69 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLcold# 0 0
76 # FDATA: 1 chain #LLchain1_LLexit# 1 chain #LLexit# 0 10
81 .size chain, LLchain_end-chain
92 # FDATA: 1 main #LLmain_chain1# 1 chain 0 0 500
96 # FDATA: 1 main #LLmain_chain2# 1 chain 0 0 10
101 .size main, .Lmain_end-main