[BOLT] Restrict execution of tests that fail on Windows
authorRafael Auler <rafaelauler@gmail.com>
Tue, 12 Jul 2022 00:58:32 +0000 (17:58 -0700)
committerRafael Auler <rafaelauler@fb.com>
Tue, 12 Jul 2022 00:59:58 +0000 (17:59 -0700)
Turn off execution of tests that use UNIX-specific features.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D126933

13 files changed:
bolt/test/AArch64/asm-func-debug.test
bolt/test/R_ABS.pic.lld.cpp
bolt/test/X86/double-jump.test
bolt/test/X86/jmp-optimization.test
bolt/test/X86/jump-table-icp.test
bolt/test/X86/shrinkwrapping.test
bolt/test/bad-exe.test
bolt/test/bolt-info.test
bolt/test/invalid-profile.test
bolt/test/no-relocs.test
bolt/test/pie.test
bolt/test/re-optimize.test
bolt/test/shared-object.test

index 37499ec..c585aa9 100644 (file)
@@ -14,7 +14,7 @@ CHECK-NEXT:       DW_AT_low_pc (0x0000000000000000)
 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:
index e07c9d1..b139620 100644 (file)
@@ -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
  */
index fa2271b..237ca4c 100644 (file)
@@ -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 \
index 0953b7a..92f4b9a 100644 (file)
@@ -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
index 7ed77d3..708f127 100644 (file)
@@ -4,6 +4,10 @@ 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
 
+# 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 \
index 594a87e..1767db2 100644 (file)
@@ -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 | \
index 8b2ffe2..6c1d8cc 100644 (file)
@@ -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
index 862c255..c329c55 100644 (file)
@@ -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" | \
index dfb4fb0..1725a08 100644 (file)
@@ -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
 
index 97168cb..9e22705 100644 (file)
@@ -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
 
index 611b98c..e8aaa91 100644 (file)
@@ -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
 
index 8bcac0c..38f3cf9 100644 (file)
@@ -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
index a255357..361f4ea 100644 (file)
@@ -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