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 <[email protected]> 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

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to