[cfe-commits] r173496 - /cfe/trunk/test/FixIt/typo.c

Dmitri Gribenko gribozavr at gmail.com
Fri Jan 25 13:41:30 PST 2013


Author: gribozavr
Date: Fri Jan 25 15:41:29 2013
New Revision: 173496

URL: http://llvm.org/viewvc/llvm-project?rev=173496&view=rev
Log:
Migrate test from grep to -fdiagnostics-parseable-fixits

Modified:
    cfe/trunk/test/FixIt/typo.c

Modified: cfe/trunk/test/FixIt/typo.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/typo.c?rev=173496&r1=173495&r2=173496&view=diff
==============================================================================
--- cfe/trunk/test/FixIt/typo.c (original)
+++ cfe/trunk/test/FixIt/typo.c Fri Jan 25 15:41:29 2013
@@ -1,8 +1,9 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 // RUN: cp %s %t
 // RUN: not %clang_cc1 -fsyntax-only -fixit -x c %t
 // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t
-// RUN: grep "Rectangle" %t
+
 struct Point {
   float x, y;
 };
@@ -21,17 +22,24 @@
 
 struct Window window = {
   .bunds. // expected-error{{field designator 'bunds' does not refer to any field in type 'struct Window'; did you mean 'bounds'?}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:4-[[@LINE-1]]:9}:"bounds"
+
   topleft.x = 3.14, // expected-error{{field designator 'topleft' does not refer to any field in type 'struct Rectangle'; did you mean 'top_left'?}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:10}:"top_left"
   2.71818, 5.0, 6.0, Red
 };
 
 void test() {
   Rectangle r1; // expected-error{{must use 'struct' tag to refer to type 'Rectangle'}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:3}:"struct "
   r1.top_left.x = 0;
 
   typedef struct Rectangle Rectangle; // expected-note{{'Rectangle' declared here}}
   rectangle *r2 = &r1; // expected-error{{unknown type name 'rectangle'; did you mean 'Rectangle'?}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:12}:"Rectangle"
+
   r2->top_left.y = 0;
   unsinged *ptr = 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:11}:"unsigned"
   *ptr = 17;
 }





More information about the cfe-commits mailing list