From: Richard Smith Date: Wed, 5 Dec 2012 22:54:26 +0000 (+0000) Subject: PR10867. lit would interpret X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=00fb9c429e4400f3daeb87e6fad9498d4c73862a;p=oota-llvm.git PR10867. lit would interpret RUN: a RUN: b || true as "a && (b || true)" in Tcl mode, and as "(a && b) || true" in sh mode. Everyone seems to (quite reasonably) write tests assuming the Tcl behavior, so use that in sh mode too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169441 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/llvm-lit/chain.c b/test/tools/llvm-lit/chain.c new file mode 100644 index 00000000000..6f6541d2e46 --- /dev/null +++ b/test/tools/llvm-lit/chain.c @@ -0,0 +1,9 @@ +// This test should fail. lit used to interpret this as: +// (false && false) || true +// instead of the intended +// false && (false || true +// +// RUN: false +// RUN: false || true +// +// XFAIL: * diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index e339652f834..fa4880a593a 100644 --- a/utils/lit/lit/TestRunner.py +++ b/utils/lit/lit/TestRunner.py @@ -241,11 +241,16 @@ def executeShCmd(cmd, cfg, cwd, results): return exitCode def executeScriptInternal(test, litConfig, tmpBase, commands, cwd): - ln = ' &&\n'.join(commands) - try: - cmd = ShUtil.ShParser(ln, litConfig.isWindows).parse() - except: - return (Test.FAIL, "shell parser error on: %r" % ln) + cmds = [] + for ln in commands: + try: + cmds.append(ShUtil.ShParser(ln, litConfig.isWindows).parse()) + except: + return (Test.FAIL, "shell parser error on: %r" % ln) + + cmd = cmds[0] + for c in cmds[1:]: + cmd = ShUtil.Seq(cmd, '&&', c) results = [] try: