[PATCH] Port test/Driver/mg.c to use FileCheck instead of fgrep
Jonathan Roelofs
jonathan at codesourcery.com
Wed Feb 4 09:19:47 PST 2015
On 2/4/15 10:18 AM, Ben Langmuir wrote:
>
>> On Feb 4, 2015, at 9:12 AM, Jonathan Roelofs <jroelofs.lists at gmail.com> wrote:
>>
>>
>>
>> On 2/4/15 10:01 AM, Ben Langmuir wrote:
>>>> Index: llvm/tools/clang/test/Driver/mg.c
>>>> ===================================================================
>>>> --- llvm.orig/tools/clang/test/Driver/mg.c
>>>> +++ llvm/tools/clang/test/Driver/mg.c
>>>> @@ -1,5 +1,5 @@
>>>> -// RUN: %clang -M -MG -include nonexistent-preinclude.h %s > %t
>>>> -// RUN: grep -F nonexistent-preinclude.h %t
>>>> -// RUN: grep -F nonexistent-ppinclude.h %t
>>>> +// RUN: %clang -M -MG -include nonexistent-preinclude.h %s 2>&1 | FileCheck %s
>>>> +// CHECK: nonexistent-preinclude.h
>>>> +// CHECK: nonexistent-ppinclude.h
>>>>
>>>> #include "nonexistent-ppinclude.h”
>>>
>>>
>>> Is there a reason you’ve redirected stderr to stdout? The original test only checked stdout and there shouldn’t be anything on stderr.
>> I think the new version is better... It at least checks that there's no stderr output before what the test actually looks for.
>
> That’s not true: this test will still ignore anything other than what it checks for. I think that’s fine here, I just wanted to see what the intent was.
Oops, you're right. Realized that right after I hit 'send'.
Jon
>
> Ben
--
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded
More information about the cfe-commits
mailing list