diff options
Diffstat (limited to 'bolt/test')
-rw-r--r-- | bolt/test/AArch64/missing-code-marker.s | 26 | ||||
-rw-r--r-- | bolt/test/X86/debug-fission-single-convert.s | 5 | ||||
-rw-r--r-- | bolt/test/X86/debug-fission-single.s | 5 | ||||
-rw-r--r-- | bolt/test/X86/inlined-function-mixed.test | 6 | ||||
-rw-r--r-- | bolt/test/binary-analysis/AArch64/cmdline-args.test | 11 | ||||
-rw-r--r-- | bolt/test/lsda-section-name.cpp | 4 |
6 files changed, 43 insertions, 14 deletions
diff --git a/bolt/test/AArch64/missing-code-marker.s b/bolt/test/AArch64/missing-code-marker.s new file mode 100644 index 0000000..591c9ab --- /dev/null +++ b/bolt/test/AArch64/missing-code-marker.s @@ -0,0 +1,26 @@ +## Check that llvm-bolt is able to recover a missing code marker. + +# RUN: %clang %cflags %s -o %t.exe -nostdlib -fuse-ld=lld -Wl,-q +# RUN: llvm-bolt %t.exe -o %t.bolt 2>&1 | FileCheck %s + +# CHECK: BOLT-WARNING: function symbol foo lacks code marker + +.text +.balign 4 + +.word 0 + +## Function foo starts immediately after a data object and does not have +## a matching "$x" symbol to indicate the start of code. +.global foo +.type foo, %function +foo: + .word 0xd65f03c0 +.size foo, .-foo + +.global _start +.type _start, %function +_start: + bl foo + ret +.size _start, .-_start diff --git a/bolt/test/X86/debug-fission-single-convert.s b/bolt/test/X86/debug-fission-single-convert.s index 02c92902..ea05ccd 100644 --- a/bolt/test/X86/debug-fission-single-convert.s +++ b/bolt/test/X86/debug-fission-single-convert.s @@ -14,14 +14,15 @@ # RUN: -nostartfiles \ # RUN: -Wl,--script=%p/Inputs/debug-fission-script.txt \ # RUN: %t.o -o %t.exe +# RUN: mkdir -p %t.dwarf-output # RUN: llvm-bolt %t.exe \ # RUN: --reorder-blocks=reverse \ # RUN: --update-debug-sections \ -# RUN: --dwarf-output-path=%T \ +# RUN: --dwarf-output-path=%t.dwarf-output \ # RUN: --always-convert-to-ranges=true \ # RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s # RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest -# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest +# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest # RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO # RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC diff --git a/bolt/test/X86/debug-fission-single.s b/bolt/test/X86/debug-fission-single.s index 1aa502f..7ff53df 100644 --- a/bolt/test/X86/debug-fission-single.s +++ b/bolt/test/X86/debug-fission-single.s @@ -14,13 +14,14 @@ # RUN: -nostartfiles \ # RUN: -Wl,--script=%p/Inputs/debug-fission-script.txt \ # RUN: %t.o -o %t.exe +# RUN: mkdir -p %t.dwarf-output # RUN: llvm-bolt %t.exe \ # RUN: --reorder-blocks=reverse \ # RUN: --update-debug-sections \ -# RUN: --dwarf-output-path=%T \ +# RUN: --dwarf-output-path=%t.dwarf-output \ # RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s # RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest -# RUN: llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest +# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest # RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO # RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC diff --git a/bolt/test/X86/inlined-function-mixed.test b/bolt/test/X86/inlined-function-mixed.test index 9f6ef39..4fc1594 100644 --- a/bolt/test/X86/inlined-function-mixed.test +++ b/bolt/test/X86/inlined-function-mixed.test @@ -1,9 +1,9 @@ ## Make sure inlining from a unit with debug info into unit without ## debug info does not cause a crash. -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: %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 diff --git a/bolt/test/binary-analysis/AArch64/cmdline-args.test b/bolt/test/binary-analysis/AArch64/cmdline-args.test index 76f7c3b..3e70b2c 100644 --- a/bolt/test/binary-analysis/AArch64/cmdline-args.test +++ b/bolt/test/binary-analysis/AArch64/cmdline-args.test @@ -4,14 +4,15 @@ # Verify that an error message is provided if an input file is missing or incorrect RUN: not llvm-bolt-binary-analysis 2>&1 | FileCheck -check-prefix=NOFILEARG %s -NOFILEARG: llvm-bolt-binary-analysis: Not enough positional command line arguments specified! -NOFILEARG-NEXT: Must specify at least 1 positional argument: See: {{.*}}llvm-bolt-binary-analysis --help +NOFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: Not enough positional command line arguments specified! +NOFILEARG-NEXT: Must specify at least 1 positional argument: See: {{.*}}llvm-bolt-binary-analysis{{(\.exe)?}} --help RUN: not llvm-bolt-binary-analysis non-existing-file 2>&1 | FileCheck -check-prefix=NONEXISTINGFILEARG %s -NONEXISTINGFILEARG: llvm-bolt-binary-analysis: 'non-existing-file': No such file or directory. +# Don't check the OS-dependent message "No such file or directory". +NONEXISTINGFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: 'non-existing-file': {{.*}} RUN: not llvm-bolt-binary-analysis %p/Inputs/dummy.txt 2>&1 | FileCheck -check-prefix=NOELFFILEARG %s -NOELFFILEARG: llvm-bolt-binary-analysis: '{{.*}}/Inputs/dummy.txt': The file was not recognized as a valid object file. +NOELFFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: '{{.*}}/Inputs/dummy.txt': The file was not recognized as a valid object file. RUN: %clang %cflags -Wl,--emit-relocs %p/../../Inputs/asm_foo.s %p/../../Inputs/asm_main.c -o %t.exe RUN: llvm-bolt-binary-analysis %t.exe 2>&1 | FileCheck -check-prefix=VALIDELFFILEARG --allow-empty %s @@ -26,7 +27,7 @@ RUN: llvm-bolt-binary-analysis --help 2>&1 | FileCheck -check-prefix=HELP %s HELP: OVERVIEW: BinaryAnalysis HELP-EMPTY: -HELP-NEXT: USAGE: llvm-bolt-binary-analysis [options] <executable> +HELP-NEXT: USAGE: llvm-bolt-binary-analysis{{(\.exe)?}} [options] <executable> HELP-EMPTY: HELP-NEXT: OPTIONS: HELP-EMPTY: diff --git a/bolt/test/lsda-section-name.cpp b/bolt/test/lsda-section-name.cpp index 929b17f..e91d0ac 100644 --- a/bolt/test/lsda-section-name.cpp +++ b/bolt/test/lsda-section-name.cpp @@ -1,8 +1,8 @@ // This test check that LSDA section named by .gcc_except_table.main is // disassembled by BOLT. -// RUN: %clang++ %cxxflags -O3 -no-pie -c %s -o %t.o -// RUN: %clang++ %cxxflags -O3 -no-pie -fuse-ld=lld %t.o -o %t +// RUN: %clangxx %cxxflags -O3 -no-pie -c %s -o %t.o +// RUN: %clangxx %cxxflags -O3 -no-pie -fuse-ld=lld %t.o -o %t // RUN: llvm-objcopy --rename-section .gcc_except_table=.gcc_except_table.main %t // RUN: llvm-readelf -SW %t | FileCheck %s // RUN: llvm-bolt %t -o %t.bolt |