From ddd0bb8dba2a367c6aa8a25e98915509847745ce Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Thu, 12 Dec 2019 11:39:57 +0000 Subject: [PATCH] [lit] Remove lit's REQUIRES-ANY directive Summary: Remove REQUIRES-ANY alias lit directive since it is hardly used and can be easily implemented using an OR expression using REQUIRES. Fixup remaining testcases still using REQUIRES-ANY. Reviewers: probinson, jdenny, gparker42 Reviewed By: gparker42 Subscribers: eugenis, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, delcypher, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits, #sanitizers, llvm-commits Tags: #llvm, #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D71408 --- clang/test/Driver/XRay/xray-instrument-macos.c | 2 +- clang/test/Driver/XRay/xray-instrument-os.c | 2 +- .../Driver/XRay/xray-instrumentation-bundles-flags.cpp | 4 ++-- clang/test/Driver/XRay/xray-mode-flags.cpp | 4 ++-- clang/test/Driver/XRay/xray-nolinkdeps.cpp | 4 ++-- compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c | 2 +- compiler-rt/test/builtins/Unit/arm/aeabi_cdcmple_test.c | 2 +- compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c | 2 +- compiler-rt/test/builtins/Unit/arm/aeabi_cfcmple_test.c | 2 +- compiler-rt/test/builtins/Unit/arm/aeabi_drsub_test.c | 2 +- compiler-rt/test/builtins/Unit/arm/aeabi_frsub_test.c | 2 +- compiler-rt/test/builtins/Unit/arm/aeabi_idivmod_test.c | 2 +- .../test/builtins/Unit/arm/aeabi_uidivmod_test.c | 2 +- .../test/builtins/Unit/arm/aeabi_uldivmod_test.c | 2 +- compiler-rt/test/builtins/Unit/riscv/mulsi3_test.c | 2 +- llvm/utils/lit/lit/TestRunner.py | 17 ----------------- .../tests/Inputs/shtest-format/requires-any-missing.txt | 2 -- .../tests/Inputs/shtest-format/requires-any-present.txt | 2 -- 18 files changed, 18 insertions(+), 39 deletions(-) delete mode 100644 llvm/utils/lit/tests/Inputs/shtest-format/requires-any-missing.txt delete mode 100644 llvm/utils/lit/tests/Inputs/shtest-format/requires-any-present.txt diff --git a/clang/test/Driver/XRay/xray-instrument-macos.c b/clang/test/Driver/XRay/xray-instrument-macos.c index afccc62..ce68345 100644 --- a/clang/test/Driver/XRay/xray-instrument-macos.c +++ b/clang/test/Driver/XRay/xray-instrument-macos.c @@ -1,4 +1,4 @@ // RUN: %clang -o /dev/null -v -fxray-instrument -target x86_64-apple-macos10.11 -c %s // RUN: %clang -o /dev/null -v -fxray-instrument -target x86_64-apple-darwin15 -c %s -// REQUIRES-ANY: x86_64, x86_64h +// REQUIRES: x86_64 || x86_64h typedef int a; diff --git a/clang/test/Driver/XRay/xray-instrument-os.c b/clang/test/Driver/XRay/xray-instrument-os.c index 3a0c428..ba97328 100644 --- a/clang/test/Driver/XRay/xray-instrument-os.c +++ b/clang/test/Driver/XRay/xray-instrument-os.c @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s // XFAIL: -linux-, -freebsd, -darwin, -macos -// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 +// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64 typedef int a; diff --git a/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp b/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp index da25355..b68dca2 100644 --- a/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp +++ b/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp @@ -7,5 +7,5 @@ // RUN: | FileCheck %s // CHECK: -fxray-instrumentation-bundle=function // -// REQUIRES-ANY: linux, freebsd -// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 +// REQUIRES: linux || freebsd +// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64 diff --git a/clang/test/Driver/XRay/xray-mode-flags.cpp b/clang/test/Driver/XRay/xray-mode-flags.cpp index 281cf0b..e95053a 100644 --- a/clang/test/Driver/XRay/xray-mode-flags.cpp +++ b/clang/test/Driver/XRay/xray-mode-flags.cpp @@ -45,5 +45,5 @@ // FDR: libclang_rt.xray-fdr // NONE-NOT: libclang_rt.xray-basic // NONE-NOT: libclang_rt.xray-fdr -// REQUIRES-ANY: linux, freebsd -// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 +// REQUIRES: linux || freebsd +// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64 diff --git a/clang/test/Driver/XRay/xray-nolinkdeps.cpp b/clang/test/Driver/XRay/xray-nolinkdeps.cpp index 5a79e36..5461fc3 100644 --- a/clang/test/Driver/XRay/xray-nolinkdeps.cpp +++ b/clang/test/Driver/XRay/xray-nolinkdeps.cpp @@ -4,5 +4,5 @@ // RUN: 2>&1 | FileCheck --check-prefix ENABLE %s // ENABLE: clang_rt.xray // DISABLE-NOT: clang_rt.xray -// REQUIRES-ANY: linux, freebsd -// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 +// REQUIRES: linux || freebsd +// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64 diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c index bdd357c..894294f 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %arm_call_apsr -o %t.aspr.o // RUN: %clang_builtins %s %t.aspr.o %librt -o %t && %run %t //===-- aeabi_cdcmpeq.c - Test __aeabi_cdcmpeq ----------------------------===// diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmple_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmple_test.c index 1bfbb4e..01096e6 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmple_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmple_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %arm_call_apsr -o %t.aspr.o // RUN: %clang_builtins %s %t.aspr.o %librt -o %t && %run %t diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c index 9a98179..f1fc6fa 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %arm_call_apsr -o %t.aspr.o // RUN: %clang_builtins %s %t.aspr.o %librt -o %t && %run %t //===-- aeabi_cfcmpeq.c - Test __aeabi_cfcmpeq ----------------------------===// diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmple_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmple_test.c index 7d3ff78..d3c882b 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmple_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmple_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %arm_call_apsr -o %t.aspr.o // RUN: %clang_builtins %s %t.aspr.o %librt -o %t && %run %t diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_drsub_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_drsub_test.c index 2c66891..1a1aa28 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_drsub_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_drsub_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %clang_builtins %s %librt -o %t && %run %t //===-- aeabi_drsub.c - Test __aeabi_drsub --------------------------------===// // diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_frsub_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_frsub_test.c index 2fadfb2..bcd6ee6 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_frsub_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_frsub_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %clang_builtins %s %librt -o %t && %run %t //===-- aeabi_frsub.c - Test __aeabi_frsub --------------------------------===// // diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_idivmod_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_idivmod_test.c index cec9468..f6ec478 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_idivmod_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_idivmod_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %clang_builtins %s %librt -o %t && %run %t //===-- aeabi_idivmod_test.c - Test __aeabi_idivmod -----------------------===// // diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_uidivmod_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_uidivmod_test.c index e29cd5a..3b8f378 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_uidivmod_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_uidivmod_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %clang_builtins %s %librt -o %t && %run %t //===-- aeabi_uidivmod_test.c - Test __aeabi_uidivmod ---------------------===// // diff --git a/compiler-rt/test/builtins/Unit/arm/aeabi_uldivmod_test.c b/compiler-rt/test/builtins/Unit/arm/aeabi_uldivmod_test.c index 465d3bf..b8a646e 100644 --- a/compiler-rt/test/builtins/Unit/arm/aeabi_uldivmod_test.c +++ b/compiler-rt/test/builtins/Unit/arm/aeabi_uldivmod_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: arm-target-arch,armv6m-target-arch +// REQUIRES: arm-target-arch || armv6m-target-arch // RUN: %clang_builtins %s %librt -o %t && %run %t //===-- aeabi_uldivmod_test.c - Test aeabi_uldivmod -----------------------===// // diff --git a/compiler-rt/test/builtins/Unit/riscv/mulsi3_test.c b/compiler-rt/test/builtins/Unit/riscv/mulsi3_test.c index 8383d45..3496b2d 100644 --- a/compiler-rt/test/builtins/Unit/riscv/mulsi3_test.c +++ b/compiler-rt/test/builtins/Unit/riscv/mulsi3_test.c @@ -1,4 +1,4 @@ -// REQUIRES-ANY: riscv32-target-arch +// REQUIRES: riscv32-target-arch // RUN: %clang_builtins %s %librt -o %t && %run %t //===-- mulsi3_test.c - Test __mulsi3 -------------------------------------===// // diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index eec61f4..d572af2 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -1304,20 +1304,6 @@ class IntegratedTestKeywordParser(object): BooleanExpression.evaluate(s, []) return output - @staticmethod - def _handleRequiresAny(line_number, line, output): - """A custom parser to transform REQUIRES-ANY: into REQUIRES:""" - - # Extract the conditions specified in REQUIRES-ANY: as written. - conditions = [] - IntegratedTestKeywordParser._handleList(line_number, line, conditions) - - # Output a `REQUIRES: a || b || c` expression in its place. - expression = ' || '.join(conditions) - IntegratedTestKeywordParser._handleBooleanExpr(line_number, - expression, output) - return output - def parseIntegratedTestScript(test, additional_parsers=[], require_script=True): """parseIntegratedTestScript - Scan an LLVM/Clang style integrated test @@ -1341,9 +1327,6 @@ def parseIntegratedTestScript(test, additional_parsers=[], initial_value=test.xfails), IntegratedTestKeywordParser('REQUIRES:', ParserKind.BOOLEAN_EXPR, initial_value=test.requires), - IntegratedTestKeywordParser('REQUIRES-ANY:', ParserKind.CUSTOM, - IntegratedTestKeywordParser._handleRequiresAny, - initial_value=test.requires), IntegratedTestKeywordParser('UNSUPPORTED:', ParserKind.BOOLEAN_EXPR, initial_value=test.unsupported), IntegratedTestKeywordParser('END.', ParserKind.TAG) diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/requires-any-missing.txt b/llvm/utils/lit/tests/Inputs/shtest-format/requires-any-missing.txt deleted file mode 100644 index c977ee9..0000000 --- a/llvm/utils/lit/tests/Inputs/shtest-format/requires-any-missing.txt +++ /dev/null @@ -1,2 +0,0 @@ -RUN: true -REQUIRES-ANY: a-missing-feature, a-missing-feature-2 diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/requires-any-present.txt b/llvm/utils/lit/tests/Inputs/shtest-format/requires-any-present.txt deleted file mode 100644 index f3be518..0000000 --- a/llvm/utils/lit/tests/Inputs/shtest-format/requires-any-present.txt +++ /dev/null @@ -1,2 +0,0 @@ -RUN: true -REQUIRES-ANY: a-missing-feature, a-present-feature -- 2.7.4