summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/tests/Inputs/shtest-format
diff options
context:
space:
mode:
authorGreg Parker <gparker@apple.com>2017-01-24 09:58:02 +0000
committerGreg Parker <gparker@apple.com>2017-01-24 09:58:02 +0000
commited0a95cbece2e0ed7162439ae3cd0c97bb346380 (patch)
treefc79a0fcedfd549adb23aa8e0e76ba9cdc8b5392 /llvm/utils/lit/tests/Inputs/shtest-format
parente3c2051d2722cbbe1188d0f009c46b5c6f7c1b7e (diff)
downloadbcm5719-llvm-ed0a95cbece2e0ed7162439ae3cd0c97bb346380.tar.gz
bcm5719-llvm-ed0a95cbece2e0ed7162439ae3cd0c97bb346380.zip
[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
A `lit` condition line is now a comma-separated list of boolean expressions. Comma-separated expressions act as if each expression were on its own condition line: For REQUIRES, if every expression is true then the test will run. For UNSUPPORTED, if every expression is false then the test will run. For XFAIL, if every expression is false then the test is expected to succeed. As a special case "XFAIL: *" expects the test to fail. Examples: # Test is expected fail on 64-bit Apple simulators and pass everywhere else XFAIL: x86_64 && apple && !macosx # Test is unsupported on Windows and on non-Ubuntu Linux # and supported everywhere else UNSUPPORTED: linux && !ubuntu, system-windows Syntax: * '&&', '||', '!', '(', ')'. '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.) * All other identifiers are false. * Identifiers are [-+=._a-zA-Z0-9]+ Differential Revision: https://reviews.llvm.org/D18185 llvm-svn: 292904
Diffstat (limited to 'llvm/utils/lit/tests/Inputs/shtest-format')
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/requires-missing.txt7
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/requires-present.txt4
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/requires-star.txt3
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt3
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-false.txt9
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-true.txt4
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/unsupported-star.txt3
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-false.txt3
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-true.txt4
9 files changed, 37 insertions, 3 deletions
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/requires-missing.txt b/llvm/utils/lit/tests/Inputs/shtest-format/requires-missing.txt
index 9e6648d8b8f..d643e57edca 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-format/requires-missing.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/requires-missing.txt
@@ -1,2 +1,5 @@
-RUN: true
-REQUIRES: a-missing-feature
+# REQUIRES with a false clause. Test should not run.
+REQUIRES: true
+REQUIRES: a-missing-feature, true
+REQUIRES: true
+RUN: false
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/requires-present.txt b/llvm/utils/lit/tests/Inputs/shtest-format/requires-present.txt
index 064f7074a76..9fcbdca69be 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-format/requires-present.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/requires-present.txt
@@ -1,2 +1,4 @@
+# REQUIRES with only true clauses. Test should run.
+REQUIRES: a-present-feature, true, !not-true
+REQUIRES: true
RUN: true
-REQUIRES: a-present-feature
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/requires-star.txt b/llvm/utils/lit/tests/Inputs/shtest-format/requires-star.txt
new file mode 100644
index 00000000000..5566d8b15b0
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/requires-star.txt
@@ -0,0 +1,3 @@
+# '*' only works in XFAIL
+REQUIRES: *
+RUN: false
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt b/llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt
new file mode 100644
index 00000000000..6470bf40414
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/requires-triple.txt
@@ -0,0 +1,3 @@
+# REQUIRES line that uses target triple, which doesn't work. Test should not run
+REQUIRES: x86_64
+RUN: false
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-false.txt b/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-false.txt
new file mode 100644
index 00000000000..00c6160a367
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-false.txt
@@ -0,0 +1,9 @@
+# UNSUPPORTED with only false clauses. Test should run.
+UNSUPPORTED: false
+UNSUPPORTED: false, not-true
+UNSUPPORTED: false
+UNSUPPORTED: still-not-true
+UNSUPPORTED: false
+UNSUPPORTED: false
+UNSUPPORTED: false
+RUN: true
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-true.txt b/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-true.txt
new file mode 100644
index 00000000000..f48ba7b2c2d
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-expr-true.txt
@@ -0,0 +1,4 @@
+# UNSUPPORTED with a true clause. Test should not run.
+UNSUPPORTED: false
+UNSUPPORTED: false, false, false, _64-unk && a-present-feature, false
+RUN: false
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-star.txt b/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-star.txt
new file mode 100644
index 00000000000..16630207dac
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/unsupported-star.txt
@@ -0,0 +1,3 @@
+# '*' only works in XFAIL
+UNSUPPORTED: *
+RUN: false
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-false.txt b/llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-false.txt
new file mode 100644
index 00000000000..83b0de1621d
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-false.txt
@@ -0,0 +1,3 @@
+# XFAIL with only false clauses. Test should run.
+XFAIL: false, a-missing-feature || ! a-present-feature || ! x86_64, false
+RUN: true
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-true.txt b/llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-true.txt
new file mode 100644
index 00000000000..3c197484897
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/xfail-expr-true.txt
@@ -0,0 +1,4 @@
+# XFAIL with a true clause. Test should not run.
+XFAIL: false
+XFAIL: false, a-present-feature && ! a-missing-feature && x86_64
+RUN: false
OpenPOWER on IntegriCloud