[LLVMdev] lit: deprecating trailing \ in RUN lines

Alp Toker alp at nuanti.com
Tue Dec 10 11:26:41 PST 2013


On 10/12/2013 18:03, Jim Grosbach wrote:
>> That causes dissonance between what the compiler sees and what lit.py 
>> sees for no particularly good reason. One of the nice properties of 
>> lit tests is that they're also valid compiler inputs, so trailing 
>> slash is a bit unfortunate.
>>
>
> How does the backslash break this in any way?

The backslash is interpreted by lit and the compiler in different and 
incompatible ways.

Spot the problem in this reduced example..

// expected-no-diagnostics

// RUN: %clang_cc1 %s -verify -emit-llvm -o - | \
__attribute__((packed))  // no warning
int  x;

// RUN: FileCheck %s
// CHECK: @x = common global i32 0, align 4


It is easier to get this wrong than it is to get it right -- in effect, 
lit is encouraging use of backslash line continuations which are 
guaranteed to change the meaning of the following line in C/C++ with a 
silent failure mode. This is concerning for a C/C++ compiler test suite :-)

It's problematic because the feature hides test issues in and of itself 
by being incompatible with C, but moreover because it breaks stock tools 
used to check code and comments due to the complex sub-grammar introduced.

It's really important to me that there's buy-in for this though -- the 
last thing I want is for people to say "Alp made my tests hard to read" 
after the fact(!)

Cheers,
Alp.


-- 
http://www.nuanti.com
the browser experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131210/ea9b504c/attachment.html>


More information about the llvm-dev mailing list