mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-28 08:02:08 +00:00
[BOLT][TEST] Use double dash flags in tests
Replace a single dash with a double dash for options that have more than a single letter. llvm-bolt-wrapper.py has special treatment for output options such as "-o" and "-w" causing issues when a single dash is used, e.g. for "-write-dwp". The wrapper can be fixed as well, but using a double dash has other advantages as well. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D127538
This commit is contained in:
parent
02f4affe2d
commit
d648aa1b8e
@ -4,7 +4,7 @@
|
||||
# The input test case foo() contains nops that we remove.
|
||||
|
||||
RUN: %clang %cflags -no-pie -gdwarf-4 %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe
|
||||
RUN: llvm-bolt %t.exe -o %t -update-debug-sections
|
||||
RUN: llvm-bolt %t.exe -o %t --update-debug-sections
|
||||
RUN: llvm-dwarfdump -all %t | FileCheck %s
|
||||
|
||||
# Check ranges were created/updated for asm compile unit
|
||||
|
@ -6,7 +6,7 @@
|
||||
# RUN: %s -o %t.o
|
||||
# RUN: %clang %cflags -fPIC -pie %t.o -o %t.exe -Wl,-q \
|
||||
# RUN: -nostartfiles -nodefaultlibs -Wl,-z,notext
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -use-old-text=0 -lite=0 -trap-old-code
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --use-old-text=0 --lite=0 --trap-old-code
|
||||
# RUN: llvm-objdump -d --disassemble-symbols='$d' %t.bolt | FileCheck %s
|
||||
|
||||
.text
|
||||
|
@ -4,7 +4,7 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
|
||||
# RUN: %s -o %t.o
|
||||
# RUN: %clang %cflags -fPIC -pie %t.o -o %t.exe -Wl,-q -nostdlib -Wl,-z,notext
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -use-old-text=0 -lite=0
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --use-old-text=0 --lite=0
|
||||
# RUN: llvm-objdump -j .text -dR %t.bolt | FileCheck %s
|
||||
|
||||
# CHECK: R_AARCH64_RELATIVE *ABS*+0x[[#%x,ADDR:]]
|
||||
|
@ -1,7 +1,7 @@
|
||||
// A contrived example to test the double jump removal peephole.
|
||||
|
||||
// RUN: %clang %cflags -O0 %s -o %t.exe
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt -peepholes=double-jumps | \
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt --peepholes=double-jumps | \
|
||||
// RUN: FileCheck %s -check-prefix=CHECKBOLT
|
||||
// RUN: llvm-objdump -d %t.bolt | FileCheck %s
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
|
||||
# RUN: %clang %cflags -nostartfiles -nodefaultlibs %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -peepholes=double-jumps
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --peepholes=double-jumps
|
||||
|
||||
.text
|
||||
.align 4
|
||||
|
@ -3,7 +3,7 @@
|
||||
# - DW_AT_high_pc is in the form of DW_FORM_addr.
|
||||
|
||||
RUN: yaml2obj %p/Inputs/go_dwarf.yaml &> %t.exe
|
||||
RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
|
||||
# Check the original binary values.
|
||||
RUN: llvm-dwarfdump -debug-info %t.exe 2>&1 | \
|
||||
|
@ -4,8 +4,8 @@
|
||||
// to the symbol name e.g. memcpy@@GLIBC_2.17
|
||||
|
||||
// RUN: yaml2obj %p/Inputs/plt-gnu-ld.yaml &> %t.exe
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt.exe -use-old-text=0 -lite=0 \
|
||||
// RUN: -print-cfg -print-only=main | FileCheck %s
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt.exe --use-old-text=0 --lite=0 \
|
||||
// RUN: --print-cfg --print-only=main | FileCheck %s
|
||||
|
||||
// CHECK: memcpy@PLT
|
||||
// CHECK: memset@PLT
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
RUN: yaml2obj %p/Inputs/rels-so.yaml &> %t.so
|
||||
RUN: yaml2obj %p/Inputs/rels-exe.yaml &> %t.exe
|
||||
RUN: llvm-bolt %t.so -o %t.bolt.so -use-old-text=0 -lite=0
|
||||
RUN: llvm-bolt %t.exe -o %t.bolt.exe -use-old-text=0 -lite=0
|
||||
RUN: llvm-bolt %t.so -o %t.bolt.so --use-old-text=0 --lite=0
|
||||
RUN: llvm-bolt %t.exe -o %t.bolt.exe --use-old-text=0 --lite=0
|
||||
|
||||
// Check relocations in library:
|
||||
|
||||
@ -27,7 +27,7 @@ CHECKEXE: {{.*}} R_AARCH64_JUMP_SLOT {{.*}} inc + 0
|
||||
// the initial binary was built with gcc and ld with -mtls-dialect=trad flag.
|
||||
|
||||
RUN: yaml2obj %p/Inputs/tls-trad.yaml &> %t.trad.so
|
||||
RUN: llvm-bolt %t.trad.so -o %t.trad.bolt.so -use-old-text=0 -lite=0
|
||||
RUN: llvm-bolt %t.trad.so -o %t.trad.bolt.so --use-old-text=0 --lite=0
|
||||
RUN: llvm-readelf -rW %t.trad.so | FileCheck %s -check-prefix=CHECKTRAD
|
||||
|
||||
CHECKTRAD: {{.*}} R_AARCH64_TLS_DTPMOD64 {{.*}} t1 + 0
|
||||
@ -37,7 +37,7 @@ CHECKTRAD: {{.*}} R_AARCH64_TLS_DTPREL64 {{.*}} t1 + 0
|
||||
// it is emitted correctly.
|
||||
|
||||
RUN: yaml2obj %p/Inputs/tls-ld.yaml &> %t.ld.so
|
||||
RUN: llvm-bolt %t.ld.so -o %t.ld.bolt.so -use-old-text=0 -lite=0
|
||||
RUN: llvm-bolt %t.ld.so -o %t.ld.bolt.so --use-old-text=0 --lite=0
|
||||
RUN: llvm-readelf -rW %t.ld.bolt.so | FileCheck %s -check-prefix=CHECKLD
|
||||
|
||||
CHECKLD: {{.*}} R_AARCH64_TLSDESC {{.*}} t1 + 0
|
||||
|
@ -3,6 +3,6 @@
|
||||
// normally.
|
||||
|
||||
RUN: yaml2obj %p/Inputs/skip-got-rel.yaml &> %t.exe
|
||||
RUN: llvm-bolt %t.exe -o /dev/null -print-cfg -print-only=_start | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe -o /dev/null --print-cfg --print-only=_start | FileCheck %s
|
||||
|
||||
CHECK: adr x0, foo2
|
||||
|
@ -3,8 +3,8 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
|
||||
# RUN: %s -o %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -peepholes=tailcall-traps \
|
||||
# RUN: -print-peepholes -funcs=foo,bar 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --peepholes=tailcall-traps \
|
||||
# RUN: --print-peepholes --funcs=foo,bar 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: Binary Function "foo"
|
||||
# CHECK: br x0 # TAILCALL
|
||||
|
@ -2,7 +2,7 @@
|
||||
// is properly emitted in the new section.
|
||||
|
||||
// RUN: %clang %cflags %s -o %t.exe -Wl,-q
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt -lite=0 -use-old-text=0
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0
|
||||
// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \
|
||||
// RUN: FileCheck %s
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// This test checks that multiple data objects in text of which only first is marked get disassembled properly
|
||||
|
||||
// RUN: yaml2obj %S/Inputs/unmarked-data.yaml -o %t.exe
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt -lite=0 -use-old-text=0 2>&1 | FileCheck %s
|
||||
// RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0 2>&1 | FileCheck %s
|
||||
// CHECK-NOT: BOLT-WARNING
|
||||
// RUN: llvm-objdump -j .text -d --disassemble-symbols=first,second %t.bolt | FileCheck %s -check-prefix=CHECK-SYMBOL
|
||||
// CHECK-SYMBOL: <first>:
|
||||
|
@ -2,7 +2,7 @@
|
||||
# update-debug-sections option.
|
||||
|
||||
RUN: %clang %cflags -g %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe
|
||||
RUN: llvm-bolt %t.exe -o %t -update-debug-sections
|
||||
RUN: llvm-bolt %t.exe -o %t --update-debug-sections
|
||||
|
||||
CHECK: BOLT-INFO: Target architecture: aarch64
|
||||
CHECK-NOT: Reloc num: 10
|
||||
|
@ -3,7 +3,7 @@
|
||||
* against _Z6myfuncv. The same address has a dynamic relocation against it.
|
||||
*
|
||||
* RUN: %clang %cflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld
|
||||
* RUN: llvm-bolt %t.so -o %t.so.bolt -relocs
|
||||
* RUN: llvm-bolt %t.so -o %t.so.bolt --relocs
|
||||
*/
|
||||
|
||||
unsigned long long myfunc();
|
||||
|
@ -3,10 +3,10 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: ld.lld %t.o -o %t.exe -nostdlib
|
||||
# RUN: llvm-objdump -d %t.exe | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -x86-strip-redundant-address-size=false
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --lite=0 --x86-strip-redundant-address-size=false
|
||||
# RUN: llvm-objdump -d %t.out | FileCheck %s
|
||||
# CHECK: 67 e8 {{.*}} addr32 callq {{.*}} <foo>
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -x86-strip-redundant-address-size=true
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --lite=0 --x86-strip-redundant-address-size=true
|
||||
# remove test name from objdump output, to only search for addr32 in disassembly
|
||||
# RUN: llvm-objdump -d %t.out | grep -v addr32.s | FileCheck %s --check-prefix=CHECK-STRIP
|
||||
# CHECK-STRIP-NOT: addr32
|
||||
|
@ -7,13 +7,13 @@
|
||||
* RUN: %clang -fPIC %s -o %t.exe -Wl,-q
|
||||
*
|
||||
* Profile collection: instrument the binary
|
||||
* RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata -o %t.instr
|
||||
* RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata -o %t.instr
|
||||
*
|
||||
* Profile collection: run instrumented binary (and capture output)
|
||||
* RUN: %t.instr > %t.result
|
||||
*
|
||||
* Run BOLT with asm-dump
|
||||
* RUN: llvm-bolt %t.exe -p %t.fdata -funcs=main -asm-dump=%t -o /dev/null \
|
||||
* RUN: llvm-bolt %t.exe -p %t.fdata --funcs=main --asm-dump=%t -o /dev/null \
|
||||
* RUN: | FileCheck %s --check-prefix=CHECK-BOLT
|
||||
*
|
||||
* Check asm file contents
|
||||
|
@ -4,7 +4,7 @@
|
||||
# The input test case foo() contains nops that we remove.
|
||||
|
||||
RUN: %clang -gdwarf-4 %cflags -no-pie %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe
|
||||
RUN: llvm-bolt %t.exe -o %t -update-debug-sections
|
||||
RUN: llvm-bolt %t.exe -o %t --update-debug-sections
|
||||
RUN: llvm-dwarfdump -all %t | FileCheck %s
|
||||
|
||||
# Check ranges were created/updated for asm compile unit
|
||||
|
@ -7,11 +7,11 @@ RUN: ld.lld %t.o -o %t -q
|
||||
RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t | \
|
||||
RUN: FileCheck %s --check-prefix=CHECK-DIS-NO-TRAP
|
||||
|
||||
RUN: llvm-bolt %t -trap-avx512=1 -o %t.bolt -lite=0 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t --trap-avx512=1 -o %t.bolt --lite=0 2>&1 | FileCheck %s
|
||||
RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t.bolt | \
|
||||
RUN: FileCheck %s --check-prefix=CHECK-DIS
|
||||
|
||||
RUN: llvm-bolt %t -trap-avx512=0 -o %t.bolt -lite=0
|
||||
RUN: llvm-bolt %t --trap-avx512=0 -o %t.bolt --lite=0
|
||||
RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t.bolt | \
|
||||
RUN: FileCheck %s --check-prefix=CHECK-DIS-NO-TRAP
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -lite=0 -dyno-stats \
|
||||
# RUN: -print-sctc -print-only=_start 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --lite=0 --dyno-stats \
|
||||
# RUN: --print-sctc --print-only=_start 2>&1 | FileCheck %s
|
||||
# CHECK-NOT: Assertion `BranchInfo.size() == 2 && "could only be called for blocks with 2 successors"' failed.
|
||||
# Two tail calls in the same basic block after SCTC:
|
||||
# CHECK: {{.*}}: ja {{.*}} # TAILCALL # CTCTakenCount: {{.*}}
|
||||
|
@ -2,9 +2,9 @@
|
||||
# according to the new function layout.
|
||||
|
||||
RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
|
||||
RUN: llvm-bolt %t.exe -o /dev/null -data %p/Inputs/blarge.fdata \
|
||||
RUN: -reorder-blocks=normal -print-finalized 2>&1 | FileCheck %s \
|
||||
RUN: -check-prefix=CHECK
|
||||
RUN: llvm-bolt %t.exe -o /dev/null --data %p/Inputs/blarge.fdata \
|
||||
RUN: --reorder-blocks=normal --print-finalized 2>&1 | FileCheck %s \
|
||||
RUN: --check-prefix=CHECK
|
||||
|
||||
CHECK: Binary Function "usqrt"
|
||||
CHECK: BB Layout : .LBB{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .LFT{{.*}}
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Also checks that llvm-bolt disassembler and CFG builder is working properly.
|
||||
|
||||
RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
|
||||
RUN: llvm-bolt %t.exe -o /dev/null -data %p/Inputs/blarge.fdata -print-cfg
|
||||
RUN: llvm-bolt %t.exe -o /dev/null --data %p/Inputs/blarge.fdata --print-cfg
|
||||
|
||||
CHECK: Binary Function "usqrt"
|
||||
CHECK: State : CFG constructed
|
||||
|
@ -14,10 +14,10 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: %clang %cflags %t.o -falign-labels -march=native -o %t.exe -Wl,-q
|
||||
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolted -data %t.fdata \
|
||||
# RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort \
|
||||
# RUN: -split-functions=2 -split-all-cold -split-eh -dyno-stats \
|
||||
# RUN: -print-finalized 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolted --data %t.fdata \
|
||||
# RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort \
|
||||
# RUN: --split-functions=2 --split-all-cold --split-eh --dyno-stats \
|
||||
# RUN: --print-finalized 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK-NOT: value of -2105 is too large for field of 1 byte.
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe
|
||||
# RUN: llvm-bolt %t.exe -o %t && llvm-dwarfdump -eh-frame %t | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t && llvm-dwarfdump --eh-frame %t | FileCheck %s
|
||||
#
|
||||
# CHECK: DW_CFA_advance_loc: 5
|
||||
# CHECK-NEXT: DW_CFA_def_cfa: R10 +0
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe
|
||||
# RUN: llvm-bolt %t.exe -o /dev/null -print-cfg 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o /dev/null --print-cfg 2>&1 | FileCheck %s
|
||||
#
|
||||
# CHECK: Binary Function "_Z7catchitv" after building cfg {
|
||||
# CHECK: CFI Instrs : 6
|
||||
|
@ -4,8 +4,8 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clangxx %cflags %t.o -o %t.exe
|
||||
# RUN: llvm-bolt %t.exe -o %t -reorder-blocks=cache -print-after-lowering \
|
||||
# RUN: -print-only=_Z10SolveCubicddddPiPd 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t --reorder-blocks=cache --print-after-lowering \
|
||||
# RUN: --print-only=_Z10SolveCubicddddPiPd 2>&1 | FileCheck %s
|
||||
#
|
||||
# Entry BB
|
||||
# CHECK: divsd %xmm0, %xmm1
|
||||
|
@ -4,9 +4,9 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata -o %t -lite=0 -v=2 \
|
||||
# RUN: -cmov-conversion -cmov-conversion-misprediction-threshold=-1 \
|
||||
# RUN: -cmov-conversion-bias-threshold=-1 -print-all | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata -o %t --lite=0 -v=2 \
|
||||
# RUN: --cmov-conversion --cmov-conversion-misprediction-threshold=-1 \
|
||||
# RUN: --cmov-conversion-bias-threshold=-1 --print-all | FileCheck %s
|
||||
# CHECK: BOLT-INFO: CMOVConversion: CmovInHotPath, converted static 1/1
|
||||
# CHECK: BOLT-INFO: CMOVConversion: CmovNotInHotPath, converted static 1/1
|
||||
# CHECK: BOLT-INFO: CMOVConversion: MaxIndex, converted static 1/1
|
||||
|
@ -2,7 +2,7 @@
|
||||
# a fall-through to a next function (result of builtin_unreachable()).
|
||||
|
||||
RUN: %clang %cflags %p/Inputs/ctc_and_unreachable.s -o %t.exe -Wl,-q
|
||||
RUN: llvm-bolt %t.exe -o %t -print-after-lowering -print-only=foo 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe -o %t --print-after-lowering --print-only=foo 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: Binary Function "foo"
|
||||
CHECK: cmpq $0x1, %rdi
|
||||
|
@ -4,7 +4,7 @@
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: ld.lld %t.o -o %t.exe -q --unresolved-symbols=ignore-all
|
||||
# RUN: llvm-readelf -Wr %t.exe | FileCheck %s
|
||||
# RUN: llvm-bolt -strict %t.exe -relocs -o /dev/null
|
||||
# RUN: llvm-bolt --strict %t.exe --relocs -o /dev/null
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
|
@ -43,7 +43,7 @@
|
||||
# CHECK-ADDR-SEC: 0x00000000: Addrs: [
|
||||
# CHECK-ADDR-SEC: 0x0000000000601000
|
||||
|
||||
# RUN: llvm-bolt %t.exe --reorder-blocks=reverse -update-debug-sections -dwarf-output-path=%T -o %t.bolt.2.exe --write-dwp=true
|
||||
# RUN: llvm-bolt %t.exe --reorder-blocks=reverse --update-debug-sections --dwarf-output-path=%T -o %t.bolt.2.exe --write-dwp=true
|
||||
# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %t.bolt.2.exe.dwp &> %tAddrIndexTestDwp
|
||||
# RUN: cat %tAddrIndexTestDwp | FileCheck %s --check-prefix=CHECK-DWP-DEBUG
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Test the double jump removqal peephole.
|
||||
|
||||
RUN: %clang %cflags %p/Inputs/double_jump.cpp -o %t.exe
|
||||
RUN: (llvm-bolt %t.exe -peepholes=double-jumps \
|
||||
RUN: -eliminate-unreachable -o %t 2>&1 \
|
||||
RUN: (llvm-bolt %t.exe --peepholes=double-jumps \
|
||||
RUN: --eliminate-unreachable -o %t 2>&1 \
|
||||
RUN: && llvm-objdump -d %t --print-imm-hex --no-show-raw-insn) | FileCheck %s
|
||||
|
||||
CHECK: BOLT-INFO: Peephole: 1 double jumps patched.
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
|
||||
# RUN: ld.lld %t.o -o %t.exe -q --Tdata=0x80000
|
||||
# RUN: llvm-bolt %t.exe -relocs -o /dev/null -print-only=_start -print-disasm \
|
||||
# RUN: llvm-bolt %t.exe --relocs -o /dev/null --print-only=_start --print-disasm \
|
||||
# RUN: | FileCheck %s --check-prefix=CHECK-BOLT
|
||||
# RUN: llvm-objdump -d --print-imm-hex %t.exe \
|
||||
# RUN: | FileCheck %s --check-prefix=CHECK-OBJDUMP
|
||||
|
@ -4,7 +4,7 @@
|
||||
# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags -dwarf-4 %t1.o -o %t.exe
|
||||
# RUN: llvm-objcopy --remove-section=.debug_loc %t.exe
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections &> file
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections &> file
|
||||
# RUN: cat file | FileCheck --check-prefix=CHECK %s
|
||||
|
||||
# Making sure we handle error returned by visitLocationList correctly.
|
||||
|
@ -6,7 +6,7 @@
|
||||
; RUN: --filetype=obj %p/Inputs/dwarf4-ftypes-split-dwarf.s -o=main.o
|
||||
; RUN: %clang %cflags -gdwarf-4 -gsplit-dwarf=split main.o -o main.exe
|
||||
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.dwo | FileCheck -check-prefix=PRE-BOLT %s
|
||||
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections -write-dwp
|
||||
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --write-dwp
|
||||
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.bolt.dwp | FileCheck -check-prefix=BOLT %s
|
||||
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-TU-INDEX %s
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
; RUN: llvm-dwp -e main.exe -o main.exe.dwp
|
||||
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.dwp | FileCheck -check-prefix=PRE-BOLT %s
|
||||
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.dwp | FileCheck -check-prefix=PRE-BOLT-DWP-TU-INDEX %s
|
||||
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections -write-dwp
|
||||
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --write-dwp
|
||||
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.bolt.dwp | FileCheck -check-prefix=BOLT %s
|
||||
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-TU-INDEX %s
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.bolt | FileCheck --check-prefix=POSTCHECK %s
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.bolt | FileCheck --check-prefix=POSTCHECK %s
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %tmain.o
|
||||
# RUN: %clang %cflags -dwarf-5 %tmain.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %tmain.o
|
||||
# RUN: %clang %cflags -dwarf-5 %tmain.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-loclist-offset-form-main.s -o %tmain.o
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-loclist-offset-form-helper.s -o %thelper.o
|
||||
# RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
|
||||
|
@ -3,7 +3,7 @@
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_main.s -o %tmain.o
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_helper.s -o %thelper.o
|
||||
# RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
|
||||
|
@ -3,7 +3,7 @@
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_main.s -o %tmain.o
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_helper.s -o %thelper.o
|
||||
# RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
RUN: %clang %cflags %p/../Inputs/stub.c -fPIC -pie -shared -o %t.so
|
||||
RUN: %clangxx %cxxflags -no-pie %p/Inputs/exc_args.s -o %t %t.so -Wl,-z,notext
|
||||
RUN: llvm-bolt %t -o /dev/null -print-finalized -print-only=main | FileCheck %s
|
||||
RUN: llvm-bolt %t -o /dev/null --print-finalized --print-only=main | FileCheck %s
|
||||
|
||||
CHECK: Binary Function "main" after finalize-functions
|
||||
CHECK: callq _Z3fooiiiiiiii {{.*}} GNU_args_size = 16
|
||||
|
@ -6,8 +6,8 @@ RUN: %S/Inputs/ft_to_noop.s -o %t.o
|
||||
RUN: link_fdata %S/Inputs/ft_to_noop.s %t.o %t.fdata --nmtool llvm-nm
|
||||
RUN: llvm-strip --strip-unneeded %t.o
|
||||
RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
RUN: llvm-bolt %t.exe -o %t -data %t.fdata \
|
||||
RUN: -print-cfg -sequential-disassembly 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe -o %t --data %t.fdata \
|
||||
RUN: --print-cfg --sequential-disassembly 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: Binary Function "foo" after building cfg
|
||||
CHECK: Exec Count : 20
|
||||
|
@ -7,8 +7,8 @@
|
||||
# RUN: %s -o %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
|
||||
# RUN: llvm-bolt %t.exe -print-cfg \
|
||||
# RUN: -print-only=inc_dup -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --print-cfg \
|
||||
# RUN: --print-only=inc_dup -o %t.out | FileCheck %s
|
||||
|
||||
.file "jump_table.c"
|
||||
.section .rodata
|
||||
|
@ -6,7 +6,7 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: ld.lld %t.o -o %t.exe -q
|
||||
# RUN: llvm-bolt %t.exe -relocs -o /dev/null -print-only=foo -print-disasm \
|
||||
# RUN: llvm-bolt %t.exe --relocs -o /dev/null --print-only=foo --print-disasm \
|
||||
# RUN: | FileCheck %s
|
||||
|
||||
.text
|
||||
|
@ -1,7 +1,7 @@
|
||||
RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %p/Inputs/dwarfdump-gdbindex.s -o %t.o
|
||||
RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %p/Inputs/dwarfdump-gdbindex2.s -o %t2.o
|
||||
RUN: ld.lld --gdb-index %t.o %t2.o -o %tfile.exe
|
||||
RUN: llvm-bolt %tfile.exe -o %tfile.exe.bolt -update-debug-sections
|
||||
RUN: llvm-bolt %tfile.exe -o %tfile.exe.bolt --update-debug-sections
|
||||
RUN: llvm-dwarfdump -gdb-index %tfile.exe.bolt | FileCheck %s
|
||||
|
||||
; test.cpp:
|
||||
|
@ -10,11 +10,11 @@
|
||||
# RUN: ld.lld %t.o -o %t.exe -q
|
||||
# RUN: ld.lld %t.o -o %t.pie.exe -q -pie
|
||||
# RUN: ld.lld %t.o -o %t.no-relax.exe -q --no-relax
|
||||
# RUN: llvm-bolt %t.exe -relocs -o %t.out -print-cfg -print-only=_start \
|
||||
# RUN: llvm-bolt %t.exe --relocs -o %t.out --print-cfg --print-only=_start \
|
||||
# RUN: |& FileCheck --check-prefix=BOLT %s
|
||||
# RUN: llvm-bolt %t.pie.exe -o /dev/null -print-cfg -print-only=_start \
|
||||
# RUN: llvm-bolt %t.pie.exe -o /dev/null --print-cfg --print-only=_start \
|
||||
# RUN: |& FileCheck --check-prefix=PIE-BOLT %s
|
||||
# RUN: llvm-bolt %t.no-relax.exe -o /dev/null -print-cfg -print-only=_start \
|
||||
# RUN: llvm-bolt %t.no-relax.exe -o /dev/null --print-cfg --print-only=_start \
|
||||
# RUN: |& FileCheck --check-prefix=NO-RELAX-BOLT %s
|
||||
# RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex \
|
||||
# RUN: %t.out | FileCheck --check-prefix=DISASM %s
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags %t1.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
# REQUIRES: system-linux
|
||||
|
||||
# RUN: %clang %cflags -O1 -g %p/../Inputs/icf-jump-tables.c -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -icf -o %t.bolt |& FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --icf -o %t.bolt |& FileCheck %s
|
||||
|
||||
## Check that BOLT successfully folded a function with jump table:
|
||||
# CHECK: ICF folded {{.*}}. {{[^0]}} functions had jump tables.
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Check llvm-bolt processes binaries compiled from sources that use indirect goto.
|
||||
RUN: %clang %cflags -no-pie %S/Inputs/indirect_goto.c -Wl,-q -o %t
|
||||
RUN: llvm-bolt %t -o /dev/null -relocs=1 -print-cfg -print-only=main -strict \
|
||||
RUN: llvm-bolt %t -o /dev/null --relocs=1 --print-cfg --print-only=main \
|
||||
RUN: --strict \
|
||||
RUN: 2>&1 | FileCheck %s
|
||||
|
||||
# Check that all possible destinations are included as successors.
|
||||
|
@ -5,8 +5,9 @@
|
||||
|
||||
# RUN: %clang %cflags -O1 -g %p/Inputs/inline-main.c %p/Inputs/inline-foo.c \
|
||||
# RUN: -I%p/../Inputs -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -update-debug-sections -print-debug-info \
|
||||
# RUN: -print-only=main -print-after-lowering -force-inline=foo -o %t.bolt \
|
||||
# RUN: llvm-bolt %t.exe --update-debug-sections --print-debug-info \
|
||||
# RUN: --print-only=main --print-after-lowering --force-inline=foo \
|
||||
# RUN: -o %t.bolt \
|
||||
# RUN: | FileCheck %s
|
||||
|
||||
## The call to puts() should come from inline-foo.c:
|
||||
|
@ -5,7 +5,7 @@ RUN: %clangxx %cxxflags %S/Inputs/inlined.cpp -c -o %T/inlined.o
|
||||
RUN: %clangxx %cxxflags %S/Inputs/inlinee.cpp -c -o %T/inlinee.o -g
|
||||
RUN: %clangxx %cxxflags %T/inlined.o %T/inlinee.o -o %t
|
||||
|
||||
RUN: llvm-bolt %t -o %t.bolt -update-debug-sections -reorder-blocks=reverse \
|
||||
RUN: -inline-small-functions -force-inline=main | FileCheck %s
|
||||
RUN: llvm-bolt %t -o %t.bolt --update-debug-sections --reorder-blocks=reverse \
|
||||
RUN: --inline-small-functions --force-inline=main | FileCheck %s
|
||||
|
||||
CHECK-NOT: BOLT: 0 out of {{.*}} functions were overwritten
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
|
||||
# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
|
||||
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
# Delete our BB symbols so BOLT doesn't mark them as entry points
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: ld.lld %t.o -o %t.exe -q -shared -fini=_fini
|
||||
# RUN: llvm-bolt -instrument %t.exe -relocs -o %t.out
|
||||
# RUN: llvm-bolt --instrument %t.exe --relocs -o %t.out
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
|
@ -7,7 +7,7 @@
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %t.o -o %t.exe -Wl,-q
|
||||
|
||||
# RUN: llvm-bolt -instrument %t.exe -relocs -o %t.out
|
||||
# RUN: llvm-bolt --instrument %t.exe --relocs -o %t.out
|
||||
|
||||
.text
|
||||
.globl main
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: %clangxx %cxxflags -no-pie %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -dump-dot-all -funcs=main.* 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --dump-dot-all --funcs=main.* \
|
||||
# RUN: 2>&1 | FileCheck %s
|
||||
#
|
||||
# CHECK-NOT: Assertion `isValid()' failed.
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
|
||||
# RUN: %s -o %t.o
|
||||
# RUN: %clang %cflags -no-pie %t.o -o %t.exe
|
||||
# RUN: llvm-bolt %t.exe -relocs=0 -jump-tables=move -print-finalized \
|
||||
# RUN: llvm-bolt %t.exe --relocs=0 --jump-tables=move --print-finalized \
|
||||
# RUN: -o %t.out | FileCheck %s
|
||||
|
||||
# CHECK: BOLT-INFO: UCE removed 0 blocks and 0 bytes of code.
|
||||
|
@ -3,7 +3,7 @@
|
||||
# in a JT"
|
||||
|
||||
# RUN: yaml2obj %p/Inputs/issue20.yaml &> %t.exe
|
||||
# RUN: llvm-bolt %t.exe -relocs=0 -jump-tables=move -print-finalized \
|
||||
# RUN: llvm-bolt %t.exe --relocs=0 --jump-tables=move --print-finalized \
|
||||
# RUN: -o %t.out | FileCheck %s
|
||||
|
||||
CHECK: BOLT-INFO: UCE removed 0 blocks and 0 bytes of code.
|
||||
|
@ -7,7 +7,7 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
|
||||
# RUN: %s -o %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -relocs -print-cfg -o %t.out \
|
||||
# RUN: llvm-bolt %t.exe --relocs --print-cfg -o %t.out \
|
||||
# RUN: | FileCheck %s
|
||||
|
||||
# CHECK-NOT: BOLT-WARNING: CFG invalid in XYZ @ .LBB0
|
||||
|
@ -1,7 +1,7 @@
|
||||
# This reproduces issue 26 from our github repo
|
||||
|
||||
# RUN: yaml2obj %p/Inputs/issue26.yaml &> %t.exe
|
||||
# RUN: llvm-bolt %t.exe -relocs -print-cfg -o %t.out \
|
||||
# RUN: llvm-bolt %t.exe --relocs --print-cfg -o %t.out \
|
||||
# RUN: | FileCheck %s
|
||||
|
||||
CHECK-NOT: BOLT-WARNING: CFG invalid in XYZ @ .LBB0
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %S/Inputs/jmpjmp.s -o %t.o
|
||||
RUN: %clang %cflags %t.o -o %t.exe
|
||||
RUN: llvm-bolt %t.exe -o /dev/null -print-cfg 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe -o /dev/null --print-cfg 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: Binary Function "testfunc"
|
||||
CHECK: State : CFG constructed
|
||||
|
@ -6,8 +6,8 @@ RUN: %S/Inputs/jump_table_footprint_reduction.s -o %t.o
|
||||
RUN: link_fdata %S/Inputs/jump_table_footprint_reduction.s %t.o %t.fdata --nmtool llvm-nm
|
||||
RUN: llvm-strip --strip-unneeded %t.o
|
||||
RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
|
||||
RUN: llvm-bolt %t.exe -data %t.fdata -o /dev/null \
|
||||
RUN: -jump-tables=move -jt-footprint-reduction -assume-abi -relocs \
|
||||
RUN: llvm-bolt %t.exe --data %t.fdata -o /dev/null \
|
||||
RUN: --jump-tables=move --jt-footprint-reduction --assume-abi --relocs \
|
||||
RUN: | FileCheck %s
|
||||
|
||||
CHECK: 100.00% of dynamic JT entries were reduced.
|
||||
|
@ -4,14 +4,14 @@ RUN: link_fdata %p/Inputs/jump_table_icp.s %t.o %t.fdata --nmtool llvm-nm
|
||||
RUN: llvm-strip --strip-unneeded %t.o
|
||||
RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
|
||||
|
||||
RUN: (llvm-bolt %t.exe -data %t.fdata -o %t -relocs \
|
||||
RUN: -reorder-blocks=cache -split-functions=3 -split-all-cold \
|
||||
RUN: -use-gnu-stack -dyno-stats -indirect-call-promotion=jump-tables \
|
||||
RUN: -print-icp -v=0 \
|
||||
RUN: -icp-jt-remaining-percent-threshold=10 \
|
||||
RUN: -icp-jt-total-percent-threshold=2 \
|
||||
RUN: -indirect-call-promotion-topn=1 \
|
||||
RUN: -icp-jump-tables-targets -align-functions-max-bytes=7 2>&1 && \
|
||||
RUN: (llvm-bolt %t.exe --data %t.fdata -o %t --relocs \
|
||||
RUN: --reorder-blocks=cache --split-functions=3 --split-all-cold \
|
||||
RUN: --use-gnu-stack --dyno-stats --indirect-call-promotion=jump-tables \
|
||||
RUN: --print-icp -v=0 \
|
||||
RUN: --icp-jt-remaining-percent-threshold=10 \
|
||||
RUN: --icp-jt-total-percent-threshold=2 \
|
||||
RUN: --indirect-call-promotion-topn=1 \
|
||||
RUN: --icp-jump-tables-targets --align-functions-max-bytes=7 2>&1 && \
|
||||
RUN: llvm-objdump -d %t --print-imm-hex) | FileCheck %s
|
||||
|
||||
BOLT-INFO: ICP total indirect callsites = 0
|
||||
|
@ -2,7 +2,7 @@
|
||||
# in the same order as they appear in the input code.
|
||||
|
||||
RUN: %clang %cflags %S/Inputs/jump-table-pic.s -o %t.exe -Wl,-q
|
||||
RUN: llvm-bolt %t.exe -strict -print-cfg -print-only=main -o /dev/null \
|
||||
RUN: llvm-bolt %t.exe --strict --print-cfg --print-only=main -o /dev/null \
|
||||
RUN: | FileCheck %s
|
||||
|
||||
CHECK: BB Layout : {{.*, .*, .*,}} [[BB4to6:.*, .*, .*]]
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Verifies that BOLT detects fixed destination of indirect jump
|
||||
|
||||
RUN: %clang %cflags -no-pie %S/Inputs/jump_table_reference.s -Wl,-q -o %t
|
||||
RUN: llvm-bolt %t -relocs -o /dev/null 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t --relocs -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: BOLT-INFO: fixed indirect branch detected in main
|
||||
|
@ -5,9 +5,10 @@
|
||||
# Also checks that llvm-bolt disassembler and CFG builder is working properly.
|
||||
|
||||
RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
|
||||
RUN: llvm-bolt %t.exe -o /dev/null -data %p/Inputs/blarge.fdata \
|
||||
RUN: -reorder-blocks=normal -print-cfg -print-reordered \
|
||||
RUN: -funcs=main,SolveCubic,usqrt -sequential-disassembly 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe -o /dev/null --data %p/Inputs/blarge.fdata \
|
||||
RUN: --reorder-blocks=normal --print-cfg --print-reordered \
|
||||
RUN: --funcs=main,SolveCubic,usqrt --sequential-disassembly \
|
||||
RUN: 2>&1 | FileCheck %s
|
||||
|
||||
# Original order
|
||||
CHECK: Binary Function "main"
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Verifies that the extraction of DWARF line number information is correct.
|
||||
|
||||
RUN: %clangxx %cxxflags %S/Inputs/linenumber.cpp -g -o %t
|
||||
RUN: llvm-bolt %t -o /dev/null -print-reordered -update-debug-sections \
|
||||
RUN: -print-debug-info -reorder-blocks=reverse -sequential-disassembly 2>&1 \
|
||||
RUN: | FileCheck %s
|
||||
RUN: llvm-bolt %t -o /dev/null --print-reordered --update-debug-sections \
|
||||
RUN: --print-debug-info --reorder-blocks=reverse --sequential-disassembly \
|
||||
RUN: 2>&1 | FileCheck %s
|
||||
|
||||
# Local variable in f()
|
||||
CHECK: movl $0xbeef, -0x4(%rbp) # debug line {{.*}}linenumber.cpp:9
|
||||
|
@ -6,12 +6,15 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata2 "FDATA2"
|
||||
# RUN: link_fdata %s %t.o %t.fdata3 "FDATA3"
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata -reorder-blocks=ext-tsp -print-finalized \
|
||||
# RUN: -loop-inversion-opt -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata2 -reorder-blocks=ext-tsp -print-finalized \
|
||||
# RUN: -loop-inversion-opt -o %t.out2 | FileCheck --check-prefix="CHECK2" %s
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata3 -reorder-blocks=none -print-finalized \
|
||||
# RUN: -loop-inversion-opt -o %t.out3 | FileCheck --check-prefix="CHECK3" %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata --reorder-blocks=ext-tsp \
|
||||
# RUN: --print-finalized --loop-inversion-opt -o %t.out \
|
||||
# RUN: | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata2 --reorder-blocks=ext-tsp \
|
||||
# RUN: --print-finalized --loop-inversion-opt -o %t.out2 \
|
||||
# RUN: | FileCheck --check-prefix="CHECK2" %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata3 --reorder-blocks=none \
|
||||
# RUN: --print-finalized --loop-inversion-opt -o %t.out3 \
|
||||
# RUN: | FileCheck --check-prefix="CHECK3" %s
|
||||
|
||||
# The case where the loop is used:
|
||||
# FDATA: 1 main 2 1 main #.J1# 0 420
|
||||
|
@ -6,8 +6,9 @@ RUN: link_fdata %p/Inputs/loop_nest.s %t.o %t.fdata --nmtool llvm-nm
|
||||
RUN: llvm-strip --strip-unneeded %t.o
|
||||
RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
|
||||
|
||||
RUN: llvm-bolt %t.exe -o %t -data=%t.fdata \
|
||||
RUN: -print-cfg -print-loops -sequential-disassembly -lite=0 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe -o %t --data=%t.fdata \
|
||||
RUN: --print-cfg --print-loops --sequential-disassembly --lite=0 \
|
||||
RUN: 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: Binary Function "main{{.*}}" after building cfg
|
||||
CHECK: Loop Info for Function "main{{.*}}"
|
||||
|
@ -4,7 +4,7 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata -o /dev/null | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata -o /dev/null | FileCheck %s
|
||||
|
||||
## Check that profile is correctly matched by functions with variable suffixes.
|
||||
## E.g., LTO-generated name foo.llvm.123 should match foo.llvm.*.
|
||||
|
@ -5,7 +5,7 @@ RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %S/Inputs/entry.s -o %
|
||||
RUN: link_fdata %S/Inputs/entry.s %t.o %t.fdata --nmtool llvm-nm
|
||||
RUN: llvm-strip --strip-unneeded %t.o
|
||||
RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
RUN: llvm-bolt %t.exe -data %t.fdata -o /dev/null -reorder-blocks=normal \
|
||||
RUN: -funcs=_start -print-reordered -sequential-disassembly | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe --data %t.fdata -o /dev/null --reorder-blocks=normal \
|
||||
RUN: --funcs=_start --print-reordered --sequential-disassembly | FileCheck %s
|
||||
|
||||
CHECK: BB Layout : .LBB00, {{.*}}
|
||||
|
@ -7,8 +7,8 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -print-profile-stats -o /dev/null \
|
||||
# RUN: -data %t.fdata | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --print-profile-stats -o /dev/null \
|
||||
# RUN: --data %t.fdata | FileCheck %s
|
||||
|
||||
.text
|
||||
.globl main
|
||||
|
@ -1,6 +1,6 @@
|
||||
## Check correctness of processing .plt.sec with 8-byte entries.
|
||||
# RUN: yaml2obj %p/Inputs/plt-sec-8-byte.yaml &> %t.exe
|
||||
# RUN: llvm-bolt %t.exe -print-cfg -print-only=main -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --print-cfg --print-only=main -o %t.out | FileCheck %s
|
||||
|
||||
CHECK: callq printf@PLT
|
||||
CHECK: callq exit@PLT
|
||||
|
@ -1,11 +1,11 @@
|
||||
## Check that llvm-bolt correctly identifies functions in .plt.sec
|
||||
# RUN: yaml2obj %p/Inputs/plt-sec.yaml &> %t.exe
|
||||
# RUN: llvm-bolt %t.exe -print-cfg -print-only=foo -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --print-cfg --print-only=foo -o %t.out | FileCheck %s
|
||||
|
||||
## Check that llvm-bolt correctly identifies functions in .plt.got that has
|
||||
## endbr instruction at the start of its entries.
|
||||
# RUN: yaml2obj %p/Inputs/plt-got-sec.yaml &> %t.exe
|
||||
# RUN: llvm-bolt %t.exe -print-cfg -print-only=foo -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --print-cfg --print-only=foo -o %t.out | FileCheck %s
|
||||
|
||||
## The only call instruction in function foo() should be a call to PLT.
|
||||
CHECK: callq puts@PLT
|
||||
|
@ -1,7 +1,7 @@
|
||||
# This script checks that DataReader in llvm-bolt is reading data correctly
|
||||
|
||||
RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
|
||||
RUN: llvm-bolt %t.exe -o /dev/null -data %p/Inputs/blarge.fdata --dump-data \
|
||||
RUN: llvm-bolt %t.exe -o /dev/null --data %p/Inputs/blarge.fdata --dump-data \
|
||||
RUN: 2>&1 | sort | FileCheck %s -check-prefix=CHECK
|
||||
|
||||
CHECK: main 1105 SolveCubic 0 0 151
|
||||
|
@ -3,7 +3,7 @@
|
||||
RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-unknown -o %t.o \
|
||||
RUN: %S/Inputs/relaxed_tc.s
|
||||
RUN: ld.lld %t.o -o %t.exe -q
|
||||
RUN: llvm-bolt %t.exe -relocs -o %t
|
||||
RUN: llvm-bolt %t.exe --relocs -o %t
|
||||
RUN: llvm-objdump -d --disassemble-symbols=foo %t | FileCheck %s
|
||||
|
||||
CHECK: eb 00 jmp {{.*}} <bar>
|
||||
|
@ -5,9 +5,9 @@ RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %S/Inputs/entry.s -o %
|
||||
RUN: link_fdata %S/Inputs/entry.s %t.o %t.fdata --nmtool llvm-nm
|
||||
RUN: llvm-strip --strip-unneeded %t.o
|
||||
RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
RUN: llvm-bolt %t.exe -data %t.fdata -o %t -funcs=_start \
|
||||
RUN: -eliminate-unreachable -reorder-blocks=none \
|
||||
RUN: -print-finalized -sequential-disassembly 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t.exe --data %t.fdata -o %t --funcs=_start \
|
||||
RUN: --eliminate-unreachable --reorder-blocks=none \
|
||||
RUN: --print-finalized --sequential-disassembly 2>&1 | FileCheck %s
|
||||
|
||||
# Optimized
|
||||
CHECK: BB Layout : .LBB00, .Ltmp0, .Ltmp2, .Ltmp3, .Ltmp4, .Ltmp5, .Ltmp6, .Ltmp7, .Ltmp8, .Ltmp9, .Ltmp10, .Ltmp11
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Check for the simplification of .rodata loads.
|
||||
|
||||
RUN: %clang %cflags %p/Inputs/rodata_simpl_loads.s -o %t.exe
|
||||
RUN: llvm-bolt %t.exe -o %t -simplify-rodata-loads
|
||||
RUN: llvm-bolt %t.exe -o %t --simplify-rodata-loads
|
||||
RUN: FileCheck %s --check-prefix=ORIGINAL --input-file %p/Inputs/rodata_simpl_loads.s
|
||||
RUN: llvm-objdump -d %t --print-imm-hex --disassemble-symbols=main | FileCheck %s
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
# Check that we don't accidentally optimize out a tail call.
|
||||
|
||||
RUN: %clang %cflags %S/Inputs/sctc_bug.s -o %t
|
||||
RUN: llvm-bolt %t -o /dev/null -funcs=main -print-after-lowering 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t -o /dev/null --funcs=main --print-after-lowering \
|
||||
RUN: 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: jp .L{{.*}}
|
||||
CHECK: je foo # TAILCALL
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Check that conditional tail call is not treated as a regular tail call by SCTC.
|
||||
|
||||
RUN: %clang %cflags %S/Inputs/sctc_bug2.s -o %t
|
||||
RUN: llvm-bolt %t -o /dev/null -funcs=main -print-after-lowering \
|
||||
RUN: -sequential-disassembly 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t -o /dev/null --funcs=main --print-after-lowering \
|
||||
RUN: --sequential-disassembly 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: .LFT1
|
||||
CHECK: ja .Ltmp0
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Check that we don't accidentally optimize out a tail call.
|
||||
|
||||
RUN: %clang %cflags %S/Inputs/sctc_bug3.s -o %t
|
||||
RUN: llvm-bolt %t -o /dev/null -funcs=main -print-after-lowering \
|
||||
RUN: -sequential-disassembly 2>&1 | FileCheck %s
|
||||
RUN: llvm-bolt %t -o /dev/null --funcs=main --print-after-lowering \
|
||||
RUN: --sequential-disassembly 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: .LBB00 (1 instructions, align : 1)
|
||||
CHECK: cmpq %rdi, 0x0
|
||||
|
@ -2,7 +2,7 @@
|
||||
# RUN: mkdir %t
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64 -dwarf-version=4 %s -o %t/shared-abbrev.o
|
||||
# RUN: %clang %cflags %t/shared-abbrev.o -o %t/shared-abbrev.exe
|
||||
# RUN: llvm-bolt %t/shared-abbrev.exe -o %t/shared-abbrev.exe.bolt -update-debug-sections
|
||||
# RUN: llvm-bolt %t/shared-abbrev.exe -o %t/shared-abbrev.exe.bolt --update-debug-sections
|
||||
# RUN: llvm-dwarfdump --debug-info %t/shared-abbrev.exe.bolt | FileCheck %s
|
||||
|
||||
# CHECK: 0x00000000:
|
||||
|
@ -8,9 +8,9 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata \
|
||||
# RUN: -frame-opt=all -simplify-conditional-tail-calls=false \
|
||||
# RUN: -eliminate-unreachable=false | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata \
|
||||
# RUN: --frame-opt=all --simplify-conditional-tail-calls=false \
|
||||
# RUN: --eliminate-unreachable=false | FileCheck %s
|
||||
|
||||
# Here we have a function that aligns the stack at prologue. Stack pointer
|
||||
# analysis can't try to infer offset positions after AND because that depends
|
||||
|
@ -8,9 +8,9 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -relocs -o %t.out -data %t.fdata \
|
||||
# RUN: -frame-opt=all -simplify-conditional-tail-calls=false \
|
||||
# RUN: -eliminate-unreachable=false
|
||||
# RUN: llvm-bolt %t.exe --relocs -o %t.out --data %t.fdata \
|
||||
# RUN: --frame-opt=all --simplify-conditional-tail-calls=false \
|
||||
# RUN: --eliminate-unreachable=false
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
|
@ -7,8 +7,8 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -frame-opt=all -lite=0 \
|
||||
# RUN: -print-fop 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --frame-opt=all --lite=0 \
|
||||
# RUN: --print-fop 2>&1 | FileCheck %s
|
||||
|
||||
# Check shrink wrapping results:
|
||||
# CHECK: BOLT-INFO: Shrink wrapping moved 0 spills inserting load/stores and 1 spills inserting push/pops
|
||||
|
@ -8,8 +8,8 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -frame-opt=all -lite=0 \
|
||||
# RUN: -print-fop 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --frame-opt=all --lite=0 \
|
||||
# RUN: --print-fop 2>&1 | FileCheck %s
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
|
@ -6,7 +6,7 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -frame-opt=all -lite=0
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --frame-opt=all --lite=0
|
||||
|
||||
|
||||
.globl _start
|
||||
|
@ -3,8 +3,8 @@
|
||||
# frame pointers.
|
||||
|
||||
RUN: %clangxx %cxxflags -no-pie %S/Inputs/exc4sw.S -o %t.exe -Wl,-q
|
||||
RUN: llvm-bolt %t.exe -o %t -relocs -frame-opt=all \
|
||||
RUN: -data=%p/Inputs/exc4sw.fdata -reorder-blocks=cache 2>&1 | \
|
||||
RUN: llvm-bolt %t.exe -o %t --relocs --frame-opt=all \
|
||||
RUN: --data=%p/Inputs/exc4sw.fdata --reorder-blocks=cache 2>&1 | \
|
||||
RUN: FileCheck %s --check-prefix=CHECK-BOLT
|
||||
|
||||
RUN: llvm-objdump --dwarf=frames %t.exe | grep -A20 -e \
|
||||
|
@ -7,7 +7,7 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -v=1 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --lite=0 -v=1 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK-NOT: unclaimed PC-relative relocations left in data
|
||||
# CHECK: BOLT-INFO: marking main.cold.1 as a fragment of main
|
||||
|
@ -7,7 +7,7 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -v=1 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --lite=0 -v=1 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK-NOT: unclaimed PC-relative relocations left in data
|
||||
# CHECK: BOLT-INFO: marking main.cold as a fragment of main
|
||||
|
@ -6,7 +6,7 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -lite=0 -v=1 2>&1 | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --lite=0 -v=1 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK-NOT: unclaimed PC-relative relocations left in data
|
||||
# CHECK: BOLT-INFO: marking main.cold.1 as a fragment of main
|
||||
|
@ -1,6 +1,6 @@
|
||||
# RUN: yaml2obj %p/Inputs/srol-bug-input.yaml &> %t.exe
|
||||
# RUN: llvm-bolt %t.exe -simplify-rodata-loads -print-finalized -relocs=0 \
|
||||
# RUN: -print-disasm -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --simplify-rodata-loads --print-finalized --relocs=0 \
|
||||
# RUN: --print-disasm -o %t.out | FileCheck %s
|
||||
|
||||
CHECK: Binary Function "myfunc" after disassembly {
|
||||
CHECK: 00000000: addl mydata(%rip), %edx
|
||||
|
@ -3,8 +3,8 @@
|
||||
RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
|
||||
RUN: %p/Inputs/user-order.S -o %t.o
|
||||
RUN: ld.lld %t.o --emit-relocs --nostdlib -o %t.exe
|
||||
RUN: llvm-bolt %t.exe -o %t -reorder-functions=user \
|
||||
RUN: -function-order=%p/Inputs/order.txt
|
||||
RUN: llvm-bolt %t.exe -o %t --reorder-functions=user \
|
||||
RUN: --function-order=%p/Inputs/order.txt
|
||||
|
||||
RUN: llvm-readelf -Ws %t | cut -d':' -f2- | sort -u | FileCheck %s
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: link_fdata %s %t.o %t.fdata2 "FDATA2"
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata -reorder-blocks=none -print-finalized \
|
||||
# RUN: -tail-duplication=cache -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata2 -reorder-blocks=none -print-finalized \
|
||||
# RUN: -tail-duplication=cache -o %t.out2 | FileCheck --check-prefix="CHECK2" %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata --reorder-blocks=none \
|
||||
# RUN: --print-finalized --tail-duplication=cache -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata2 --reorder-blocks=none \
|
||||
# RUN: --print-finalized --tail-duplication=cache -o %t.out2 \
|
||||
# RUN: | FileCheck --check-prefix="CHECK2" %s
|
||||
|
||||
# A test where the tail is duplicated to eliminate an uncoditional jump
|
||||
# FDATA: 1 main #.BB0_br# 1 main #.BB4# 0 100
|
||||
|
@ -8,8 +8,8 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q -nostdlib
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -relocs \
|
||||
# RUN: -tail-duplication=aggressive
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --relocs \
|
||||
# RUN: --tail-duplication=aggressive
|
||||
.globl _start
|
||||
_start:
|
||||
jmp d
|
||||
|
@ -5,8 +5,9 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
|
||||
|
||||
# RUN: llvm-bolt %t.exe -data %t.fdata -print-finalized \
|
||||
# RUN: -tail-duplication=moderate -tail-duplication-minimum-offset 1 -o %t.out | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe --data %t.fdata --print-finalized \
|
||||
# RUN: --tail-duplication=moderate --tail-duplication-minimum-offset=1 \
|
||||
# RUN: -o %t.out | FileCheck %s
|
||||
|
||||
# FDATA: 1 main f 1 main 19 0 10
|
||||
# FDATA: 1 main f 1 main 11 0 13
|
||||
|
@ -8,9 +8,9 @@
|
||||
# RUN: link_fdata %s %t.o %t.fdata
|
||||
# RUN: llvm-strip --strip-unneeded %t.o
|
||||
# RUN: %clangxx %cflags -no-pie %t.o -o %t.exe -Wl,-q
|
||||
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -relocs \
|
||||
# RUN: -tail-duplication=aggressive \
|
||||
# RUN: -print-cfg | FileCheck %s
|
||||
# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --relocs \
|
||||
# RUN: --tail-duplication=aggressive \
|
||||
# RUN: --print-cfg | FileCheck %s
|
||||
# CHECK: Jump table {{.*}} for function a at {{.*}} with a total count of 3
|
||||
.globl main
|
||||
main:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user