[PATCH] D18185: [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
Greg Parker via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 15 07:20:37 PDT 2016
gparker42 created this revision.
gparker42 added a subscriber: llvm-commits.
This change allows the conditions in lit test files (REQUIRES, XFAIL, UNSUPPORTED) to be boolean expressions.
The change is otherwise intended to preserve the behavior of existing conditions in test files. I verified that these test suites run unchanged on OS X: llvm; llvm-lit; swift; clang (after a small patch). Additional test coverage is appreciated.
A condition line is now a comma-separated list of boolean expressions.
For REQUIRES, if each expression is True then the test will run.
For UNSUPPORTED, if each expression is False then the test will run.
For XFAIL, if each expression is False then the test is expected to fail. As a special case "XFAIL: *" also expects the test to fail.
These are the same behaviors as the current comma-separated list of features and/or targets.
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 and apple and not macosx
# Test is unsupported on Windows and non-Ubuntu Linux and supported everywhere else
UNSUPPORTED: linux and not ubuntu, system-windows
* 'and', 'or', 'not', '(', ')'. 'True' is True. 'False' is False.
* Each test feature is a True identifier.
* Substrings of the target triple are True identifiers for UNSUPPORTED and XFAIL, but not for REQUIRES. This matches the current behavior. (FIXME should this be changed?)
* All other identifiers are False.
* Identifiers are [_a-zA-Z][-=:/_a-zA-Z0-9]* . This allows all feature variable names used in llvm and clang and swift today.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 26957 bytes
Desc: not available
More information about the llvm-commits