diff --git a/bolt/test/AArch64/asm-func-debug.test b/bolt/test/AArch64/asm-func-debug.test --- a/bolt/test/AArch64/asm-func-debug.test +++ b/bolt/test/AArch64/asm-func-debug.test @@ -14,7 +14,7 @@ CHECK-NEXT: DW_AT_ranges CHECK-NEXT: [0x0000000000[[#%x,ADDR:]], CHECK-SAME: 0x0000000000[[#ADDR+4]])) -CHECK-NEXT: DW_AT_name ("{{.*}}/asm_foo.s") +CHECK-NEXT: DW_AT_name ("{{.*}}asm_foo.s") # Check .debug_aranges was updated for asm module CHECK: .debug_aranges contents: diff --git a/bolt/test/R_ABS.pic.lld.cpp b/bolt/test/R_ABS.pic.lld.cpp --- a/bolt/test/R_ABS.pic.lld.cpp +++ b/bolt/test/R_ABS.pic.lld.cpp @@ -2,6 +2,10 @@ * Check that we don't assert on a duplicate static relocation added by lld * against _Z6myfuncv. The same address has a dynamic relocation against it. * + * This test uses the clang driver + lld and will only succeed on Linux systems + * with libc available. + * REQUIRES: system-linux + * * RUN: %clang %cflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld * RUN: llvm-bolt %t.so -o %t.so.bolt --relocs */ diff --git a/bolt/test/X86/double-jump.test b/bolt/test/X86/double-jump.test --- a/bolt/test/X86/double-jump.test +++ b/bolt/test/X86/double-jump.test @@ -1,5 +1,9 @@ # Test the double jump removqal peephole. +# This test has commands that rely on shell capabilities that won't execute +# correctly on Windows e.g. subshell execution +REQUIRES: shell + 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 \ diff --git a/bolt/test/X86/jmp-optimization.test b/bolt/test/X86/jmp-optimization.test --- a/bolt/test/X86/jmp-optimization.test +++ b/bolt/test/X86/jmp-optimization.test @@ -1,5 +1,9 @@ # Tests the optimization of functions that just do a tail call in the beginning. +# This test has commands that rely on shell capabilities that won't execute +# correctly on Windows e.g. unsupported parameter expansion +REQUIRES: shell + RUN: %clang %cflags -O2 %S/Inputs/jmp_opt{,2,3}.cpp -o %t RUN: llvm-bolt -inline-small-functions %t -o %t.bolt RUN: llvm-objdump -d %t.bolt --print-imm-hex | FileCheck %s diff --git a/bolt/test/X86/jump-table-icp.test b/bolt/test/X86/jump-table-icp.test --- a/bolt/test/X86/jump-table-icp.test +++ b/bolt/test/X86/jump-table-icp.test @@ -4,6 +4,10 @@ RUN: llvm-strip --strip-unneeded %t.o RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q +# This test has commands that rely on shell capabilities that won't execute +# correctly on Windows e.g. subshell execution +REQUIRES: shell + RUN: (llvm-bolt %t.exe --data %t.fdata -o %t --relocs \ RUN: --reorder-blocks=cache --split-functions --split-all-cold \ RUN: --use-gnu-stack --dyno-stats --indirect-call-promotion=jump-tables \ diff --git a/bolt/test/X86/shrinkwrapping.test b/bolt/test/X86/shrinkwrapping.test --- a/bolt/test/X86/shrinkwrapping.test +++ b/bolt/test/X86/shrinkwrapping.test @@ -2,6 +2,10 @@ # shrink-wrapping when optimizing a function without # frame pointers. +# This test has commands that rely on shell capabilities that won't execute +# correctly on Windows e.g. subshell execution to capture command output. +REQUIRES: shell + 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 | \ diff --git a/bolt/test/bad-exe.test b/bolt/test/bad-exe.test --- a/bolt/test/bad-exe.test +++ b/bolt/test/bad-exe.test @@ -1,5 +1,10 @@ # Check that llvm-bolt rejects input that is not a valid ELF executable # bzip2.debuginfo is the result of running "objcopy --only-keep-debug". + +# This test uses the clang driver without target flags and will only succeed +# on Linux systems where the host triple matches the target. +REQUIRES: system-linux + RUN: %clang %cflags %S/Inputs/icf-jump-tables.c -g -o %t RUN: llvm-objcopy --only-keep-debug %t %t.debuginfo RUN: not llvm-bolt %t.debuginfo -o /dev/null 2>&1 | FileCheck %s diff --git a/bolt/test/bolt-info.test b/bolt/test/bolt-info.test --- a/bolt/test/bolt-info.test +++ b/bolt/test/bolt-info.test @@ -1,4 +1,9 @@ # Check that the .bolt_info section is generated properly. + +# This test uses the clang driver without target flags and will only succeed +# on Linux systems where the host triple matches the target. +REQUIRES: system-linux + RUN: %clang %cflags %S/Inputs/icf-jump-tables.c -o %t RUN: llvm-bolt %t -o %t.bolt && \ RUN: llvm-objdump -s -j .note.bolt_info %t.bolt | grep -v "file format" | \ diff --git a/bolt/test/invalid-profile.test b/bolt/test/invalid-profile.test --- a/bolt/test/invalid-profile.test +++ b/bolt/test/invalid-profile.test @@ -1,5 +1,9 @@ # Check that llvm-bolt detects bad profile data and aborts +# This test uses the clang driver without target flags and will only succeed +# on Linux systems where the host triple matches the target. +REQUIRES: system-linux + RUN: %clang %S/Inputs/icf-jump-tables.c -o %t RUN: not llvm-bolt %t -o %t.bolt --data %t 2>&1 | FileCheck %s diff --git a/bolt/test/no-relocs.test b/bolt/test/no-relocs.test --- a/bolt/test/no-relocs.test +++ b/bolt/test/no-relocs.test @@ -1,5 +1,9 @@ # Verifies that input without relocations is rejected in relocs mode. +# This test uses the clang driver without target flags and will only succeed +# on Linux systems where the host triple matches the target. +REQUIRES: system-linux + RUN: %clang %cflags %S/Inputs/icf-jump-tables.c -o %t RUN: not llvm-bolt %t -o /dev/null --relocs 2>&1 | FileCheck %s diff --git a/bolt/test/pie.test b/bolt/test/pie.test --- a/bolt/test/pie.test +++ b/bolt/test/pie.test @@ -1,5 +1,9 @@ # Check that we do not reject position-independent executables (PIEs). +# This test uses the clang driver without target flags and will only succeed +# on Linux systems where the host triple matches the target. +REQUIRES: system-linux + RUN: %clang %cflags -fPIC -pie %p/Inputs/jump_table_icp.cpp -o %t RUN: llvm-bolt %t -o /dev/null 2>&1 | FileCheck %s diff --git a/bolt/test/re-optimize.test b/bolt/test/re-optimize.test --- a/bolt/test/re-optimize.test +++ b/bolt/test/re-optimize.test @@ -1,5 +1,9 @@ # Check that we detect re-optimization attempt. +# This test uses the clang driver without target flags and will only succeed +# on Linux systems where the host triple matches the target. +REQUIRES: system-linux + RUN: %clang %cflags %S/Inputs/icf-jump-tables.c -o %t.exe RUN: llvm-bolt %t.exe -o %t 2>&1 > /dev/null RUN: not llvm-bolt %t -o %t.bolt 2>&1 | FileCheck %s diff --git a/bolt/test/shared-object.test b/bolt/test/shared-object.test --- a/bolt/test/shared-object.test +++ b/bolt/test/shared-object.test @@ -1,4 +1,9 @@ # Test that llvm-bolt processes *.so without a failure + +# This test uses the clang driver without target flags and will only succeed +# on Linux systems where the host triple matches the target. +REQUIRES: system-linux + RUN: %clang %cflags %S/Inputs/icf-jump-tables.c -o %t.so -shared -fPIC -Wl,--build-id RUN: llvm-bolt %t.so -o %t | FileCheck %s