[llvm] 3229c97 - Revert "[lit] Have REQUIRES support the target triple"

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 15:03:56 PDT 2021


Author: Paul Robinson
Date: 2021-08-06T15:03:49-07:00
New Revision: 3229c971512404c512e041c3e88f22dbec2b650b

URL: https://github.com/llvm/llvm-project/commit/3229c971512404c512e041c3e88f22dbec2b650b
DIFF: https://github.com/llvm/llvm-project/commit/3229c971512404c512e041c3e88f22dbec2b650b.diff

LOG: Revert "[lit] Have REQUIRES support the target triple"

This reverts commit 100a7b6197863d4d5ebc97761d7e98063e164e26.

Speculating that this is the reason behind a sanitizer failure:
https://lab.llvm.org/buildbot/#/builders/37/builds/5945

Added: 
    

Modified: 
    llvm/docs/TestingGuide.rst
    llvm/utils/lit/lit/Test.py
    llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt
    llvm/utils/lit/tests/Inputs/xunit-output/lit.cfg
    llvm/utils/lit/tests/shtest-format.py

Removed: 
    


################################################################################
diff  --git a/llvm/docs/TestingGuide.rst b/llvm/docs/TestingGuide.rst
index eedeb740ebf3..cd2c012d9573 100644
--- a/llvm/docs/TestingGuide.rst
+++ b/llvm/docs/TestingGuide.rst
@@ -443,7 +443,7 @@ with debug builds or on particular platforms. Use ``REQUIRES``
 and ``UNSUPPORTED`` to control when the test is enabled.
 
 Some tests are expected to fail. For example, there may be a known bug
-that a test detects. Use ``XFAIL`` to mark a test as an expected failure.
+that the test detect. Use ``XFAIL`` to mark a test as an expected failure.
 An ``XFAIL`` test will be successful if its execution fails, and
 will be a failure if its execution succeeds.
 
@@ -465,11 +465,9 @@ list of boolean expressions. The values in each expression may be:
   expression is satisfied if any feature matches the regular expression. Regular
   expressions can appear inside an identifier, so for example ``he{{l+}}o`` would match
   ``helo``, ``hello``, ``helllo``, and so on.
-- Substrings of the target triple. These must be exact substrings, not regular
-  expressions.
+- Substrings of the target triple (``UNSUPPORTED`` and ``XFAIL`` only).
 
-| ``REQUIRES`` disables the test if any expression is false (that is,
-  the test requires all expressions to be true).
+| ``REQUIRES`` enables the test if all expressions are true.
 | ``UNSUPPORTED`` disables the test if any expression is true.
 | ``XFAIL`` expects the test to fail if any expression is true.
 

diff  --git a/llvm/utils/lit/lit/Test.py b/llvm/utils/lit/lit/Test.py
index 9e20ed30948b..77b9c235e40d 100644
--- a/llvm/utils/lit/lit/Test.py
+++ b/llvm/utils/lit/lit/Test.py
@@ -362,10 +362,9 @@ def isWithinFeatureLimits(self):
         return True
 
     def getMissingRequiredFeaturesFromList(self, features):
-        triple = getattr(self.suite.config, 'target_triple', "")
         try:
             return [item for item in self.requires
-                    if not BooleanExpression.evaluate(item, features, triple)]
+                    if not BooleanExpression.evaluate(item, features)]
         except ValueError as e:
             raise ValueError('Error in REQUIRES list:\n%s' % str(e))
 

diff  --git a/llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt b/llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt
index a8ea5c0cf404..6470bf404145 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt
@@ -1,3 +1,3 @@
-# REQUIRES line that uses target triple.
+# REQUIRES line that uses target triple, which doesn't work. Test should not run
 REQUIRES: x86_64
-RUN: true
+RUN: false

diff  --git a/llvm/utils/lit/tests/Inputs/xunit-output/lit.cfg b/llvm/utils/lit/tests/Inputs/xunit-output/lit.cfg
index 12c524bcca84..0191cc218884 100644
--- a/llvm/utils/lit/tests/Inputs/xunit-output/lit.cfg
+++ b/llvm/utils/lit/tests/Inputs/xunit-output/lit.cfg
@@ -7,4 +7,4 @@ config.suffixes = ['.ini']
 config.test_format = dummy_format.DummyFormat()
 config.test_source_root = None
 config.test_exec_root = None
-config.target_triple = ''
+config.target_triple = None

diff  --git a/llvm/utils/lit/tests/shtest-format.py b/llvm/utils/lit/tests/shtest-format.py
index b65395ea038a..a15c0f950174 100644
--- a/llvm/utils/lit/tests/shtest-format.py
+++ b/llvm/utils/lit/tests/shtest-format.py
@@ -61,7 +61,7 @@
 # CHECK: UNSUPPORTED: shtest-format :: requires-missing.txt
 # CHECK: PASS: shtest-format :: requires-present.txt
 # CHECK: UNRESOLVED: shtest-format :: requires-star.txt
-# CHECK: PASS: shtest-format :: requires-triple.txt
+# CHECK: UNSUPPORTED: shtest-format :: requires-triple.txt
 # CHECK: PASS: shtest-format :: unsupported-expr-false.txt
 # CHECK: UNSUPPORTED: shtest-format :: unsupported-expr-true.txt
 # CHECK: UNRESOLVED: shtest-format :: unsupported-star.txt
@@ -88,8 +88,8 @@
 # CHECK: shtest-format :: xpass.txt
 
 # CHECK: Testing Time:
-# CHECK: Unsupported        : 3
-# CHECK: Passed             : 7
+# CHECK: Unsupported        : 4
+# CHECK: Passed             : 6
 # CHECK: Expectedly Failed  : 4
 # CHECK: Unresolved         : 3
 # CHECK: Failed             : 4
@@ -98,7 +98,7 @@
 
 # XUNIT: <?xml version="1.0" encoding="UTF-8"?>
 # XUNIT-NEXT: <testsuites time="{{[0-9.]+}}">
-# XUNIT-NEXT: <testsuite name="shtest-format" tests="22" failures="8" skipped="3">
+# XUNIT-NEXT: <testsuite name="shtest-format" tests="22" failures="8" skipped="4">
 
 # XUNIT: <testcase classname="shtest-format.external_shell" name="fail.txt" time="{{[0-9]+\.[0-9]+}}">
 # XUNIT-NEXT: <failure{{[ ]*}}>
@@ -144,7 +144,8 @@
 # XUNIT-NEXT: </testcase>
 
 
-# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-triple.txt" time="{{[0-9]+\.[0-9]+}}"/>
+# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-triple.txt" time="{{[0-9]+\.[0-9]+}}">
+# XUNIT-NEXT:<skipped message="Missing required feature(s): x86_64"/>
 
 # XUNIT: <testcase classname="shtest-format.shtest-format" name="unsupported-expr-false.txt" time="{{[0-9]+\.[0-9]+}}"/>
 


        


More information about the llvm-commits mailing list