r179214 - FileCheck-ify some clang grep tests that use double quotes

Jordan Rose jordan_rose at apple.com
Wed Apr 10 14:41:26 PDT 2013


Dmitri pointed out to me once that a better way to do this is to use {{^}} (and optionally {{$}}) to check that a match occurs at the start of the line.

On Apr 10, 2013, at 14:10 , Reid Kleckner <reid at kleckner.net> wrote:

> Modified: cfe/trunk/test/Frontend/rewrite-macros.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/rewrite-macros.c?rev=179214&r1=179213&r2=179214&view=diff
> ==============================================================================
> --- cfe/trunk/test/Frontend/rewrite-macros.c (original)
> +++ cfe/trunk/test/Frontend/rewrite-macros.c Wed Apr 10 16:10:39 2013
> @@ -1,17 +1,21 @@
> -// RUN: %clang_cc1 -verify -rewrite-macros -o %t %s
> +// RUN: %clang_cc1 %s -verify -rewrite-macros -o %t
> +// RUN: FileCheck %s < %t
> +
> +// Any CHECK line comments are included in the output, so we use some extra
> +// regex brackets to make sure we don't match the CHECK lines themselves.
> 
> #define A(a,b) a ## b
> 
> -// RUN: grep '12 */\*A\*/ /\*(1,2)\*/' %t
> +// CHECK: 12{{ *}}/*A*/ /*(1,2)*/
> A(1,2)
> 
> -// RUN: grep '/\*_Pragma("mark")\*/' %t
> +// CHECK: /*_Pragma("{{mark}}")*/
> _Pragma("mark")
> 
> -// RUN: grep "//#warning eek" %t
> +// CHECK: /*#warning {{eek}}*/
> /* expected-warning {{eek}} */ #warning eek
> 
> -// RUN: grep "//#pragma mark mark" %t
> +// CHECK: //#pragma mark {{mark}}
> #pragma mark mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130410/ab785756/attachment.html>


More information about the cfe-commits mailing list