# 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
# 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
# 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:]]
// 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
# 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
# - 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 | \
// 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
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:
// 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
// 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
// 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
# 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
// 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
// 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>:
# 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
* 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();
# 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
* 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
# 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
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
# 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: {{.*}}
# 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{{.*}}
# 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
# 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.
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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.
# 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
# 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.
; 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
; 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
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
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
# 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
# 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
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:
# 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
# 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
# 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.
# 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.
# 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:
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
# 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
# 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
# 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
# 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.
# 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.
# 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.
# 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
# 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
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
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.
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
# 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:.*, .*, .*]]
# 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
# 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"
# 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
# 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
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{{.*}}"
# 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.*.
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, {{.*}}
# 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
## 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
## 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
# 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
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>
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
# 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
# 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
# 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
# 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
# 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:
# 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
# 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:
# 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
# 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:
# 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
# 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 \
# 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
# 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
# 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
# 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
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
# 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
# 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
# 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
# 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:
# RUN: %s -o %t.o
# 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 -reorder-blocks=ext-tsp -print-finalized \
-# RUN: -tail-duplication=moderate -tail-duplication-minimum-offset=1 -o %t.out | FileCheck %s
+# RUN: llvm-bolt %t.exe --data %t.fdata --reorder-blocks=ext-tsp \
+# RUN: --print-finalized --tail-duplication=moderate \
+# RUN: --tail-duplication-minimum-offset=1 -o %t.out | FileCheck %s
# FDATA: 1 main 2 1 main #.BB2# 0 10
# FDATA: 1 main 4 1 main #.BB2# 0 20
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: ld.lld %t.o -o %t.exe -q -nostdlib
-# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -relocs \
-# RUN: -tail-duplication=aggressive \
-# RUN: -tail-duplication-const-copy-propagation=1
+# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --relocs \
+# RUN: --tail-duplication=aggressive \
+# RUN: --tail-duplication-const-copy-propagation=1
.text
.type a, %function
# Tests the peephole that adds trap instructions following indirect tail calls.
RUN: %clang %cflags %p/Inputs/tailcall_traps.s -o %t.exe
-RUN: llvm-bolt %t.exe -o %t -peepholes=tailcall-traps \
-RUN: -print-peepholes -funcs=foo,bar 2>&1 | FileCheck %s
+RUN: llvm-bolt %t.exe -o %t --peepholes=tailcall-traps \
+RUN: --print-peepholes --funcs=foo,bar 2>&1 | FileCheck %s
CHECK: Binary Function "foo"
CHECK: jmpl *%rax # TAILCALL
# in control flow graph.
RUN: %clang %cflags %S/Inputs/tailcall.s -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 "foo"
CHECK: jmp bar # TAILCALL
REQUIRES: x86_64-linux
RUN: %clangxx %cxxflags -no-pie %p/../Inputs/vararg.s -o %t -Wl,-q
-RUN: llvm-bolt %t -o /dev/null -print-cfg -print-only=.*printf.* |& FileCheck %s
+RUN: llvm-bolt %t -o /dev/null --print-cfg --print-only=.*printf.* |& FileCheck %s
CHECK: IsSimple : 0
CHECK: Entry Point
# RUN: %s -o %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -print-cfg \
-# RUN: -print-only=main -o %t.out | FileCheck %s
+# RUN: llvm-bolt %t.exe --print-cfg \
+# RUN: --print-only=main -o %t.out | FileCheck %s
.file "rust_bug.c"
.section .rodata
REQUIRES: system-linux
RUN: %clangxx %p/Inputs/bolt_icf.cpp -g -Wl,-q -o %t.exe
-RUN: llvm-bolt %t.exe -relocs -o %t -icf 2>&1 | FileCheck %s
+RUN: llvm-bolt %t.exe --relocs -o %t --icf 2>&1 | FileCheck %s
RUN: llvm-nm -n %t | FileCheck %s -check-prefix=CHECK-SYM
CHECK: BOLT-INFO: ICF folded [[#]] out of [[#]] functions in [[#]] passes.
REQUIRES: system-linux
RUN: %clangxx %p/Inputs/bolt_icf.cpp -g -Wl,-q -o %t.exe
-RUN: llvm-bolt %t.exe -reorder-blocks=cache+ -relocs -o %t 2>&1 | FileCheck %s
+RUN: llvm-bolt %t.exe --reorder-blocks=cache+ --relocs -o %t 2>&1 | FileCheck %s
CHECK: '-reorder-blocks=cache+' is deprecated, please use '-reorder-blocks=ext-tsp' instead
# Check that llvm-bolt detects bad profile data and aborts
RUN: %clang %S/Inputs/icf-jump-tables.c -o %t
-RUN: not llvm-bolt %t -o %t.bolt -data %t 2>&1 | FileCheck %s
+RUN: not llvm-bolt %t -o %t.bolt --data %t 2>&1 | FileCheck %s
CHECK: no valid profile data found
RUN: %clang %cflags %S/Inputs/icf_baz.c %S/Inputs/icf_main.c -Wl,--icf=all,--gdb-index \
RUN: -g -o %t.exe -fuse-ld=lld
-RUN: llvm-bolt %t.exe -o %t -update-debug-sections -keep-aranges
+RUN: llvm-bolt %t.exe -o %t --update-debug-sections --keep-aranges
RUN: llvm-dwarfdump -debug-aranges %t | FileCheck %s
CHECK: Address Range Header: length = {{.*}}, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
# Verifies that input without relocations is rejected in relocs mode.
RUN: %clang %cflags %S/Inputs/icf-jump-tables.c -o %t
-RUN: not llvm-bolt %t -o /dev/null -relocs 2>&1 | FileCheck %s
+RUN: not llvm-bolt %t -o /dev/null --relocs 2>&1 | FileCheck %s
CHECK: BOLT-ERROR: relocations against code are missing from the input file.
REQUIRES: system-linux
RUN: %clang %cflags %S/Inputs/hello.c -g -o %t
-RUN: llvm-bolt %t -o %t1 -update-debug-sections -funcs=_start
+RUN: llvm-bolt %t -o %t1 --update-debug-sections --funcs=_start
RUN: llvm-readobj -S %t > %t2
RUN: llvm-readobj -S %t1 >> %t2
RUN: FileCheck %s --input-file %t2
# 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 -adr-relaxation=true
+# RUN: llvm-bolt %t.exe -o %t.bolt --adr-relaxation=true
# RUN: llvm-objdump -d --disassemble-symbols=main %t.bolt | FileCheck %s
# RUN: %t.bolt
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# 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: %t.bolt
.text
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# 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: %t.bolt
.macro panic
# REQUIRES: system-linux
# RUN: %clang %cflags -no-pie %s -o %t.exe -Wl,-q
-# 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: %t.bolt
.text
REQUIRES: system-linux
RUN: %clang %p/Inputs/basic-instrumentation.s -Wl,-q -o %t.exe
-RUN: llvm-bolt %t.exe -o %t -instrument \
-RUN: -instrumentation-file=%t \
-RUN: -instrumentation-file-append-pid
+RUN: llvm-bolt %t.exe -o %t --instrument \
+RUN: --instrumentation-file=%t \
+RUN: --instrumentation-file-append-pid
# Execute program to collect profile
RUN: rm %t.*.fdata || echo Nothing to remove
RUN: cat %t.fdata | FileCheck -check-prefix=CHECK %s
# Check BOLT works with this profile
-RUN: llvm-bolt %t.exe -data %t.fdata -o %t.2 -reorder-blocks=cache
+RUN: llvm-bolt %t.exe --data %t.fdata -o %t.2 --reorder-blocks=cache
# The instrumented profile should at least say main was called once
CHECK: main 0 0 1{{$}}
REQUIRES: system-linux
RUN: %clangxx %cxxflags -no-pie %p/Inputs/exceptions_split.cpp -Wl,-q -g -o %t_exc_split
-RUN: llvm-bolt %t_exc_split -o %t.exc -instrument -instrumentation-file=%t.fdata
+RUN: llvm-bolt %t_exc_split -o %t.exc --instrument --instrumentation-file=%t.fdata
RUN: %t.exc arg1 arg2 arg3
-RUN: llvm-bolt %t_exc_split -o %t.exc.bolted -data %t.fdata \
-RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions=3 \
-RUN: -split-eh=1 | FileCheck --check-prefix=EXCEPTIONS %s
+RUN: llvm-bolt %t_exc_split -o %t.exc.bolted --data %t.fdata \
+RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \
+RUN: --split-functions=3 --split-eh=1 \
+RUN: | FileCheck --check-prefix=EXCEPTIONS %s
EXCEPTIONS-NOT: invalid (possibly stale) profile
# Check that cold symbols are emitted with local binding.
RUN: %clangxx -fpic -Wl,-q %S/Inputs/exception4.cpp -o %t.pic
RUN: llvm-bolt %t.pic -o %t && %t 2>&1 | FileCheck %s
-RUN: llvm-bolt -relocs -use-old-text %t.pic -o %t && %t 2>&1 | FileCheck %s
+RUN: llvm-bolt --relocs --use-old-text %t.pic -o %t && %t 2>&1 | FileCheck %s
CHECK: catch 2
CHECK-NEXT: catch 1
REQUIRES: x86_64-linux
RUN: %clangxx -g %S/Inputs/exception3.cpp -o %t.exe
-RUN: llvm-bolt -align-blocks=0 %t.exe -o %t && %t 2>&1 | FileCheck %s
-RUN: llvm-bolt -reorder-blocks=reverse -align-blocks=0 %t.exe -o %t && %t 2>&1 \
+RUN: llvm-bolt --align-blocks=0 %t.exe -o %t && %t 2>&1 | FileCheck %s
+RUN: llvm-bolt --reorder-blocks=reverse --align-blocks=0 %t.exe -o %t && %t 2>&1 \
RUN: | FileCheck %s
CHECK: catch 2
; RUN: %clang %cflags -O0 %t.s -o %t.exe -Wl,-q
; RUN: llvm-objcopy --redefine-syms=%p/Inputs/fdata-escape-chars-syms.txt %t.exe
;
-; RUN: llvm-bolt %t.exe -o %t.exe.instrumented -instrument \
-; RUN: -instrumentation-file=%t.fdata
+; RUN: llvm-bolt %t.exe -o %t.exe.instrumented --instrument \
+; RUN: --instrumentation-file=%t.fdata
; RUN: %t.exe.instrumented
; RUN: cat %t.fdata | \
; RUN: FileCheck --check-prefix="FDATA_CHECK" %s
-; RUN: llvm-bolt %t.exe -o %t.fdata.exe -data %t.fdata -print-finalized | \
+; RUN: llvm-bolt %t.exe -o %t.fdata.exe --data %t.fdata --print-finalized | \
; RUN: FileCheck --check-prefix="INSTR_CHECK" %s
;
; RUN: link_fdata %p/Inputs/fdata-escape-chars.txt %t.exe %t.pre "PREAGR"
; RUN: perf2bolt %t.exe -o %t.pre.fdata -pa -p %t.pre
; RUN: cat %t.pre.fdata | FileCheck --check-prefix="PREAGR_FDATA_CHECK" %s
-; RUN: llvm-bolt %t.exe -o %t.pre.fdata.exe -data %t.pre.fdata -print-finalized | \
+; RUN: llvm-bolt %t.exe -o %t.pre.fdata.exe --data %t.pre.fdata --print-finalized | \
; RUN: FileCheck --check-prefix="PREAGR_CHECK" %s
; FDATA_CHECK: 1 symb\ backslash\\ {{([[:xdigit:]]+)}} 1 symb\ whitespace 0 0 2
# 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
-# RUN: llvm-bolt %t.exe -relocs=1 -reorder-blocks=ext-tsp -print-finalized \
-# RUN: -o %t.out -data %t.fdata | FileCheck %s
+# RUN: llvm-bolt %t.exe --relocs=1 --reorder-blocks=ext-tsp --print-finalized \
+# RUN: -o %t.out --data %t.fdata | FileCheck %s
# RUN: %t.out 1 2 3
# CHECK: BOLT-INFO
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -relocs=1 -hot-text -reorder-functions=hfsort \
-# RUN: -data %t.fdata -o %t.out | FileCheck %s
+# RUN: llvm-bolt %t.exe --relocs=1 --hot-text --reorder-functions=hfsort \
+# RUN: --data %t.fdata -o %t.out | FileCheck %s
# RUN: %t.out 1
REQUIRES: x86_64-linux
RUN: %clang %S/Inputs/indirect_goto.c -o %t -fpic -pie -Wl,-q
-RUN: llvm-bolt %t -o %t.bolt -relocs=1 -print-cfg -print-only=main \
+RUN: llvm-bolt %t -o %t.bolt --relocs=1 --print-cfg --print-only=main \
RUN: |& FileCheck %s
# The test fails as we don't update corresponding dynamic relocations.
RUN: not %t.bolt
# RUN: %s -o %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
+# RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata \
# RUN: -o %t.instrumented
# Instrumented program needs to finish returning zero
# RUN: %t.instrumented 120
# Test that the instrumented data makes sense
-# RUN: llvm-bolt %t.exe -o %t.bolted -data %t.fdata \
-# RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+ \
-# RUN: -print-only=interp -print-finalized | FileCheck %s
+# RUN: llvm-bolt %t.exe -o %t.bolted --data %t.fdata \
+# RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \
+# RUN: --print-only=interp --print-finalized | FileCheck %s
# RUN: %t.bolted 120
# RUN: %s -o %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
+# RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata \
# RUN: -o %t.instrumented
# Instrumented program needs to finish returning zero
# RUN: %t.instrumented arg1 arg2
# Test that the instrumented data makes sense
-# RUN: llvm-bolt %t.exe -o %t.bolted -data %t.fdata \
-# RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+ \
-# RUN: -print-only=main -print-finalized | FileCheck %s
+# RUN: llvm-bolt %t.exe -o %t.bolted --data %t.fdata \
+# RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \
+# RUN: --print-only=main --print-finalized | FileCheck %s
# RUN: %t.bolted arg1 arg2
RUN: %clang %cflags %s -o %t.exe -Wl,-q -pie -fpie
-RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
-RUN: -instrumentation-wait-forks=1 -conservative-instrumentation \
+RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata \
+RUN: --instrumentation-wait-forks=1 --conservative-instrumentation \
RUN: -o %t.instrumented_conservative
# Instrumented program needs to finish returning zero
RUN: %t.instrumented_conservative | FileCheck %s -check-prefix=CHECK-OUTPUT
-RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
-RUN: -instrumentation-wait-forks=1 \
+RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata \
+RUN: --instrumentation-wait-forks=1 \
RUN: -o %t.instrumented
# Instrumented program needs to finish returning zero
RUN: %t.instrumented | FileCheck %s -check-prefix=CHECK-OUTPUT
# Test that the instrumented data makes sense
-RUN: llvm-bolt %t.exe -o %t.bolted -data %t.fdata \
-RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+ \
-RUN: -print-only=interp -print-finalized
+RUN: llvm-bolt %t.exe -o %t.bolted --data %t.fdata \
+RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \
+RUN: --print-only=interp --print-finalized
RUN: %t.bolted | FileCheck %s -check-prefix=CHECK-OUTPUT
RUN: %clang %cflags %s -o %t.exe -Wl,-q -pie -fpie
-RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \
+RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata \
RUN: -o %t.instrumented
# Instrumented program needs to finish returning zero
RUN: %t.instrumented 1 2 3 | FileCheck %s -check-prefix=CHECK-OUTPUT
# Test that the instrumented data makes sense
-RUN: llvm-bolt %t.exe -o %t.bolted -data %t.fdata \
-RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+
+RUN: llvm-bolt %t.exe -o %t.bolted --data %t.fdata \
+RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+
RUN: %t.bolted 1 2 3 | FileCheck %s -check-prefix=CHECK-OUTPUT
RUN: %clang %cflags %s -o %t.so -Wl,-q -fpie -fPIC -shared -DLIB
RUN: %clang %cflags %s -o %t.exe -Wl,-q -ldl
-RUN: llvm-bolt %t.so -instrument -instrumentation-file=%t.so.fdata \
+RUN: llvm-bolt %t.so --instrument --instrumentation-file=%t.so.fdata \
RUN: -o %t.so.instrumented
# Program with instrumented shared library needs to finish returning zero
RUN: test -f %t.so.fdata
# Test that the instrumented data makes sense
-RUN: llvm-bolt %t.so -o %t.so.bolted -data %t.so.fdata \
-RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+
+RUN: llvm-bolt %t.so -o %t.so.bolted --data %t.so.fdata \
+RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+
RUN: %t.exe %t.so.bolted 1 2 | FileCheck %s -check-prefix=CHECK-OUTPUT
RUN: %clang -O3 %S/Inputs/internalcall-main.c %S/Inputs/internalcall.S -Wl,-q \
RUN: -o %t.exe
-RUN: llvm-bolt -instrument %t.exe -instrumentation-file=%t.fdata \
+RUN: llvm-bolt --instrument %t.exe --instrumentation-file=%t.fdata \
RUN: -o %t -relocs -lite=0
RUN: %t | FileCheck %s
RUN: %clang -O3 %S/Inputs/internalcall-main.c %S/Inputs/internalcall.S -Wl,-q \
RUN: -o %t.exe
-RUN: llvm-bolt %t.exe -o %t -relocs -lite=0
+RUN: llvm-bolt %t.exe -o %t --relocs --lite=0
RUN: %t | FileCheck %s
CHECK: Case 1: Result is: DEADBEEF
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags -no-pie -nostartfiles -nostdlib -lc %t.o -o %t.exe
-# RUN: llvm-bolt %t.exe -o %t.exe.bolt -relocs=0 -lite=0 -reorder-blocks=reverse
+# RUN: llvm-bolt %t.exe -o %t.exe.bolt --relocs=0 --lite=0 \
+# RUN: --reorder-blocks=reverse
# RUN: %t.exe.bolt 1 2 3
RUN: %clangxx %S/Inputs/retpoline_synthetic.cpp -fno-jump-tables -Wl,-q,-znow \
RUN: -O2 -o %t.exe
-RUN: llvm-bolt %t.exe -o %t -insert-retpolines -trap-old-code
+RUN: llvm-bolt %t.exe -o %t --insert-retpolines --trap-old-code
# Check indirect calls in the original binary
RUN: llvm-objdump -d %t.exe | FileCheck %s -check-prefix=CHECK-CALL-ORIG
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -relocs=1 -print-finalized -print-only=main -o %t.out
+# RUN: llvm-bolt %t.exe --relocs=1 --print-finalized --print-only=main -o %t.out
# RUN: %t.out 1 2
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-finalized \
-# RUN: -lite=0 -print-only=main -data %t.fdata -o %t.out | FileCheck %s
+# RUN: llvm-bolt %t.exe --relocs=1 --frame-opt=all --print-finalized \
+# RUN: --lite=0 --print-only=main --data %t.fdata -o %t.out | FileCheck %s
# RUN: %t.out
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-fop \
-# RUN: -print-only=main -data %t.fdata -o %t.out | FileCheck %s
+# RUN: llvm-bolt %t.exe --relocs=1 --frame-opt=all --print-fop \
+# RUN: --print-only=main --data %t.fdata -o %t.out | FileCheck %s
# RUN: %t.out 1
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-finalized \
-# RUN: -print-only=main -data %t.fdata -o %t.out | FileCheck %s
+# RUN: llvm-bolt %t.exe --relocs=1 --frame-opt=all --print-finalized \
+# RUN: --print-only=main --data %t.fdata -o %t.out | FileCheck %s
# RUN: %t.out
# RUN: %s -o %t.o
# 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 -reorder-blocks=ext-tsp -print-finalized \
-# RUN: -tail-duplication=moderate -tail-duplication-minimum-offset=1 -tail-duplication-const-copy-propagation=1 -o %t.out | FileCheck %s
+# RUN: llvm-bolt %t.exe --data %t.fdata --reorder-blocks=ext-tsp \
+# RUN: --print-finalized \
+# RUN: --tail-duplication=moderate --tail-duplication-minimum-offset=1 \
+# RUN: --tail-duplication-const-copy-propagation=1 -o %t.out | FileCheck %s
# RUN: %t.exe; echo $?
# RUN: %t.out; echo $?
# RUN: %s -o %t.o
# 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: -o %t.out -three-way-branch | FileCheck %s
+# RUN: llvm-bolt %t.exe --data %t.fdata --print-finalized \
+# RUN: -o %t.out --three-way-branch | FileCheck %s
# RUN: %t.exe
# RUN: %t.out
RUN: %clang %cflags -no-pie %s -o %t.exe -Wl,-q
-RUN: llvm-bolt %t.exe -relocs=1 -lite -reorder-functions=user \
-RUN: -hugify -function-order=%p/Inputs/user_func_order.txt -o %t
+RUN: llvm-bolt %t.exe --relocs=1 --lite --reorder-functions=user \
+RUN: --hugify --function-order=%p/Inputs/user_func_order.txt -o %t
RUN: llvm-nm --numeric-sort --print-armap %t | \
RUN: FileCheck %s -check-prefix=CHECK-NM
RUN: %t 1 2 3 | FileCheck %s -check-prefix=CHECK-OUTPUT
# Make sure BOLT correctly updates values based on function pointer.
RUN: %clang %cflags -no-pie %p/Inputs/fptr.c -Wl,-q -o %t.exe
-RUN: llvm-bolt %t.exe -o %t -lite=0
+RUN: llvm-bolt %t.exe -o %t --lite=0
RUN: %t | FileCheck %s
CHECK: Global = 0x[[#%x,ADDR:]]
// RUN: %clang %cflags -no-pie %s -fuse-ld=lld \
// RUN: -o %t.exe -Wl,-q
-// RUN: llvm-bolt %t.exe -o %t.bolt.exe -use-old-text=0 -lite=0
+// RUN: llvm-bolt %t.exe -o %t.bolt.exe --use-old-text=0 --lite=0
// RUN: %t.bolt.exe | FileCheck %s
// CHECK: foo
# - Direct branches
# - Unmapped calls coming from uninstrumented code (libc)
# - Direct calls
-RUN: llvm-bolt merge-fdata -o %t.inst -instrument -instrumentation-file=%t.fdata
+RUN: llvm-bolt merge-fdata -o %t.inst --instrument \
+RUN: --instrumentation-file=%t.fdata
# Execute with no input
RUN: %t.inst --version
CHECK-FDATA: 0 [unknown] 0 1 _start 0 0 1
# Check that BOLT works with this profile
-RUN: llvm-bolt merge-fdata -o %t.bolt -data %t.fdata1 \
-RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions=3 | \
-RUN: FileCheck %s --check-prefix=CHECK-BOLT1
+RUN: llvm-bolt merge-fdata -o %t.bolt --data %t.fdata1 \
+RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \
+RUN: --split-functions=3 \
+RUN: | FileCheck %s --check-prefix=CHECK-BOLT1
CHECK-BOLT1-NOT: invalid (possibly stale) profile
# Execute again
# Check profile coverage
RUN: llvm-boltdiff merge-fdata merge-fdata \
-RUN: -data %t.fdata1 -data2 %t.fdata2 -display-count=20 | \
+RUN: --data %t.fdata1 --data2 %t.fdata2 --display-count=20 | \
RUN: FileCheck %s --check-prefix=CHECK-BOLTDIFF
CHECK-BOLTDIFF: Inputs share [[#]] functions
RUN: cmp %t.fdata.base %t.fdata.inst
# Optimize using merged fdata
-RUN: llvm-bolt merge-fdata -o %t.opt -data %t.fdata.base \
-RUN: -reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions=3 | \
-RUN: FileCheck %s --check-prefix=CHECK-BOLT2
+RUN: llvm-bolt merge-fdata -o %t.opt --data %t.fdata.base \
+RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \
+RUN: --split-functions=3 \
+RUN: | FileCheck %s --check-prefix=CHECK-BOLT2
CHECK-BOLT2-NOT: invalid (possibly stale) profile
# Check that optimized binary produces the same result
// RUN: %clang %cflags %p/../Inputs/plt.c -fuse-ld=bfd \
// RUN: -o %t.bfd.exe -Wl,-q
-// RUN: llvm-bolt %t.bfd.exe -o %t.bfd.bolt.exe -use-old-text=0 -lite=0
+// RUN: llvm-bolt %t.bfd.exe -o %t.bfd.bolt.exe --use-old-text=0 --lite=0
// RUN: %t.bfd.bolt.exe | FileCheck %s
// CHECK: Test completed
// Non-PIE:
RUN: %clang %cflags -no-pie %p/../Inputs/plt.c -fuse-ld=lld \
RUN: -o %t.lld.exe -Wl,-q
-RUN: llvm-bolt %t.lld.exe -o %t.lld.bolt.exe -use-old-text=0 -lite=0
+RUN: llvm-bolt %t.lld.exe -o %t.lld.bolt.exe --use-old-text=0 --lite=0
RUN: %t.lld.bolt.exe | FileCheck %s
// PIE:
RUN: %clang %cflags -fPIC -pie %p/../Inputs/plt.c -fuse-ld=lld \
RUN: -o %t.lld.pie.exe -Wl,-q
-RUN: llvm-bolt %t.lld.pie.exe -o %t.lld.bolt.pie.exe -use-old-text=0 -lite=0
+RUN: llvm-bolt %t.lld.pie.exe -o %t.lld.bolt.pie.exe --use-old-text=0 --lite=0
RUN: %t.lld.bolt.pie.exe | FileCheck %s
CHECK: Test completed