From 6b4eb0b94a6d5e6b65aa874a65e01d8772cf7054 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Wed, 22 Sep 2021 17:58:33 -0700 Subject: [PATCH] [BOLT][TEST] Split runtime tests into test/runtime folder Summary: Create bolt/test/runtime folder and move tests that execute the binary. Move lit.local.cfg with host_arch check to the corresponding folder. Addresses issue facebookincubator/BOLT#132. AArch64/tls.c shows a different behavior with clang hence marked as XFAIL TODO: add a check for non-exec tests for a corresponding LLVM_TARGETS_TO_BUILD. (cherry picked from FBD31132234) --- bolt/test/AArch64/tls.c | 12 ++++++++---- bolt/test/{ => runtime}/AArch64/adrrelaxationpass.s | 0 bolt/test/{ => runtime}/AArch64/issue177.s | 0 bolt/test/{ => runtime}/AArch64/lit.local.cfg | 0 .../X86/Inputs/fdata-escape-chars-syms.txt | 0 .../{ => runtime}/X86/Inputs/fdata-escape-chars.txt | 0 .../{ => runtime}/X86/Inputs/user_func_order.txt | 0 bolt/test/{ => runtime}/X86/fdata-escape-chars.ll | 0 bolt/test/{ => runtime}/X86/fix-branches-jrcxz.s | 0 bolt/test/{ => runtime}/X86/hot_end_symbol.s | 0 .../test/{ => runtime}/X86/instrumentation-dup-jts.s | 0 .../{ => runtime}/X86/instrumentation-ind-calls.s | 0 .../{ => runtime}/X86/instrumentation-indirect.c | 0 bolt/test/{ => runtime}/X86/instrumentation-pie.c | 0 bolt/test/{ => runtime}/X86/instrumentation-shlib.c | 0 bolt/test/{ => runtime}/X86/interp-overwrite-bug.s | 0 bolt/test/{ => runtime}/X86/lit.local.cfg | 0 .../{ => runtime}/X86/section_reloc_with_addend.s | 0 .../{ => runtime}/X86/shrinkwrapping-alignment.s | 0 bolt/test/{ => runtime}/X86/shrinkwrapping-lock.s | 0 bolt/test/{ => runtime}/X86/shrinkwrapping-pushpop.s | 0 .../X86/tail-duplication-constant-prop.s | 0 bolt/test/{ => runtime}/X86/three-way-branch-pass.s | 0 bolt/test/{ => runtime}/X86/user-func-reorder.c | 0 24 files changed, 8 insertions(+), 4 deletions(-) rename bolt/test/{ => runtime}/AArch64/adrrelaxationpass.s (100%) rename bolt/test/{ => runtime}/AArch64/issue177.s (100%) rename bolt/test/{ => runtime}/AArch64/lit.local.cfg (100%) rename bolt/test/{ => runtime}/X86/Inputs/fdata-escape-chars-syms.txt (100%) rename bolt/test/{ => runtime}/X86/Inputs/fdata-escape-chars.txt (100%) rename bolt/test/{ => runtime}/X86/Inputs/user_func_order.txt (100%) rename bolt/test/{ => runtime}/X86/fdata-escape-chars.ll (100%) rename bolt/test/{ => runtime}/X86/fix-branches-jrcxz.s (100%) rename bolt/test/{ => runtime}/X86/hot_end_symbol.s (100%) rename bolt/test/{ => runtime}/X86/instrumentation-dup-jts.s (100%) rename bolt/test/{ => runtime}/X86/instrumentation-ind-calls.s (100%) rename bolt/test/{ => runtime}/X86/instrumentation-indirect.c (100%) rename bolt/test/{ => runtime}/X86/instrumentation-pie.c (100%) rename bolt/test/{ => runtime}/X86/instrumentation-shlib.c (100%) rename bolt/test/{ => runtime}/X86/interp-overwrite-bug.s (100%) rename bolt/test/{ => runtime}/X86/lit.local.cfg (100%) rename bolt/test/{ => runtime}/X86/section_reloc_with_addend.s (100%) rename bolt/test/{ => runtime}/X86/shrinkwrapping-alignment.s (100%) rename bolt/test/{ => runtime}/X86/shrinkwrapping-lock.s (100%) rename bolt/test/{ => runtime}/X86/shrinkwrapping-pushpop.s (100%) rename bolt/test/{ => runtime}/X86/tail-duplication-constant-prop.s (100%) rename bolt/test/{ => runtime}/X86/three-way-branch-pass.s (100%) rename bolt/test/{ => runtime}/X86/user-func-reorder.c (100%) diff --git a/bolt/test/AArch64/tls.c b/bolt/test/AArch64/tls.c index f7ba8511aa32..816b473a7c41 100644 --- a/bolt/test/AArch64/tls.c +++ b/bolt/test/AArch64/tls.c @@ -24,10 +24,14 @@ int main() { } // REQUIRES: system-linux - +// XFAIL: * // RUN: %clang %cflags -no-pie %s -o %t.exe -Wl,-q \ -// RUN: -Wl,--unresolved-symbols=ignore-all +// RUN: -Wl,--unresolved-symbols=ignore-all \ +// RUN: -target aarch64-linux -fuse-ld=ld.lld \ +// RUN: -nostdlib // RUN: llvm-bolt %t.exe -o %t.bolt -// RUN: %clang %cflags -fPIC -pie -%s -o %t_pie.exe -Wl,-q \ -// RUN: -Wl,--unresolved-symbols=ignore-all +// RUN: %clang %cflags -fPIC -pie %s -o %t_pie.exe -Wl,-q \ +// RUN: -Wl,--unresolved-symbols=ignore-all \ +// RUN: -target aarch64-linux -fuse-ld=ld.lld \ +// RUN: -nostdlib // RUN: llvm-bolt %t_pie.exe -o %t.bolt diff --git a/bolt/test/AArch64/adrrelaxationpass.s b/bolt/test/runtime/AArch64/adrrelaxationpass.s similarity index 100% rename from bolt/test/AArch64/adrrelaxationpass.s rename to bolt/test/runtime/AArch64/adrrelaxationpass.s diff --git a/bolt/test/AArch64/issue177.s b/bolt/test/runtime/AArch64/issue177.s similarity index 100% rename from bolt/test/AArch64/issue177.s rename to bolt/test/runtime/AArch64/issue177.s diff --git a/bolt/test/AArch64/lit.local.cfg b/bolt/test/runtime/AArch64/lit.local.cfg similarity index 100% rename from bolt/test/AArch64/lit.local.cfg rename to bolt/test/runtime/AArch64/lit.local.cfg diff --git a/bolt/test/X86/Inputs/fdata-escape-chars-syms.txt b/bolt/test/runtime/X86/Inputs/fdata-escape-chars-syms.txt similarity index 100% rename from bolt/test/X86/Inputs/fdata-escape-chars-syms.txt rename to bolt/test/runtime/X86/Inputs/fdata-escape-chars-syms.txt diff --git a/bolt/test/X86/Inputs/fdata-escape-chars.txt b/bolt/test/runtime/X86/Inputs/fdata-escape-chars.txt similarity index 100% rename from bolt/test/X86/Inputs/fdata-escape-chars.txt rename to bolt/test/runtime/X86/Inputs/fdata-escape-chars.txt diff --git a/bolt/test/X86/Inputs/user_func_order.txt b/bolt/test/runtime/X86/Inputs/user_func_order.txt similarity index 100% rename from bolt/test/X86/Inputs/user_func_order.txt rename to bolt/test/runtime/X86/Inputs/user_func_order.txt diff --git a/bolt/test/X86/fdata-escape-chars.ll b/bolt/test/runtime/X86/fdata-escape-chars.ll similarity index 100% rename from bolt/test/X86/fdata-escape-chars.ll rename to bolt/test/runtime/X86/fdata-escape-chars.ll diff --git a/bolt/test/X86/fix-branches-jrcxz.s b/bolt/test/runtime/X86/fix-branches-jrcxz.s similarity index 100% rename from bolt/test/X86/fix-branches-jrcxz.s rename to bolt/test/runtime/X86/fix-branches-jrcxz.s diff --git a/bolt/test/X86/hot_end_symbol.s b/bolt/test/runtime/X86/hot_end_symbol.s similarity index 100% rename from bolt/test/X86/hot_end_symbol.s rename to bolt/test/runtime/X86/hot_end_symbol.s diff --git a/bolt/test/X86/instrumentation-dup-jts.s b/bolt/test/runtime/X86/instrumentation-dup-jts.s similarity index 100% rename from bolt/test/X86/instrumentation-dup-jts.s rename to bolt/test/runtime/X86/instrumentation-dup-jts.s diff --git a/bolt/test/X86/instrumentation-ind-calls.s b/bolt/test/runtime/X86/instrumentation-ind-calls.s similarity index 100% rename from bolt/test/X86/instrumentation-ind-calls.s rename to bolt/test/runtime/X86/instrumentation-ind-calls.s diff --git a/bolt/test/X86/instrumentation-indirect.c b/bolt/test/runtime/X86/instrumentation-indirect.c similarity index 100% rename from bolt/test/X86/instrumentation-indirect.c rename to bolt/test/runtime/X86/instrumentation-indirect.c diff --git a/bolt/test/X86/instrumentation-pie.c b/bolt/test/runtime/X86/instrumentation-pie.c similarity index 100% rename from bolt/test/X86/instrumentation-pie.c rename to bolt/test/runtime/X86/instrumentation-pie.c diff --git a/bolt/test/X86/instrumentation-shlib.c b/bolt/test/runtime/X86/instrumentation-shlib.c similarity index 100% rename from bolt/test/X86/instrumentation-shlib.c rename to bolt/test/runtime/X86/instrumentation-shlib.c diff --git a/bolt/test/X86/interp-overwrite-bug.s b/bolt/test/runtime/X86/interp-overwrite-bug.s similarity index 100% rename from bolt/test/X86/interp-overwrite-bug.s rename to bolt/test/runtime/X86/interp-overwrite-bug.s diff --git a/bolt/test/X86/lit.local.cfg b/bolt/test/runtime/X86/lit.local.cfg similarity index 100% rename from bolt/test/X86/lit.local.cfg rename to bolt/test/runtime/X86/lit.local.cfg diff --git a/bolt/test/X86/section_reloc_with_addend.s b/bolt/test/runtime/X86/section_reloc_with_addend.s similarity index 100% rename from bolt/test/X86/section_reloc_with_addend.s rename to bolt/test/runtime/X86/section_reloc_with_addend.s diff --git a/bolt/test/X86/shrinkwrapping-alignment.s b/bolt/test/runtime/X86/shrinkwrapping-alignment.s similarity index 100% rename from bolt/test/X86/shrinkwrapping-alignment.s rename to bolt/test/runtime/X86/shrinkwrapping-alignment.s diff --git a/bolt/test/X86/shrinkwrapping-lock.s b/bolt/test/runtime/X86/shrinkwrapping-lock.s similarity index 100% rename from bolt/test/X86/shrinkwrapping-lock.s rename to bolt/test/runtime/X86/shrinkwrapping-lock.s diff --git a/bolt/test/X86/shrinkwrapping-pushpop.s b/bolt/test/runtime/X86/shrinkwrapping-pushpop.s similarity index 100% rename from bolt/test/X86/shrinkwrapping-pushpop.s rename to bolt/test/runtime/X86/shrinkwrapping-pushpop.s diff --git a/bolt/test/X86/tail-duplication-constant-prop.s b/bolt/test/runtime/X86/tail-duplication-constant-prop.s similarity index 100% rename from bolt/test/X86/tail-duplication-constant-prop.s rename to bolt/test/runtime/X86/tail-duplication-constant-prop.s diff --git a/bolt/test/X86/three-way-branch-pass.s b/bolt/test/runtime/X86/three-way-branch-pass.s similarity index 100% rename from bolt/test/X86/three-way-branch-pass.s rename to bolt/test/runtime/X86/three-way-branch-pass.s diff --git a/bolt/test/X86/user-func-reorder.c b/bolt/test/runtime/X86/user-func-reorder.c similarity index 100% rename from bolt/test/X86/user-func-reorder.c rename to bolt/test/runtime/X86/user-func-reorder.c