summaryrefslogtreecommitdiff
path: root/test/FixIt/typo.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-05-02 19:39:53 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-05-02 19:39:53 +0000
commit01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (patch)
tree64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/FixIt/typo.c
parentc3b054d250cdca485c71845089c316e10610ebad (diff)
Diffstat (limited to 'test/FixIt/typo.c')
-rw-r--r--test/FixIt/typo.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/FixIt/typo.c b/test/FixIt/typo.c
index 01ff3a09cf3e7..88d9dc62a1f23 100644
--- a/test/FixIt/typo.c
+++ b/test/FixIt/typo.c
@@ -1,7 +1,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: cp %s %t
-// RUN: %clang_cc1 -fsyntax-only -fixit -x c %t || true
+// 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;
};
@@ -23,3 +24,14 @@ struct Window window = {
topleft.x = 3.14, // expected-error{{field designator 'topleft' does not refer to any field in type 'struct Rectangle'; did you mean 'top_left'?}}
2.71818, 5.0, 6.0, Red
};
+
+void test() {
+ Rectangle r1; // expected-error{{must use 'struct' tag to refer to type 'Rectangle'}}
+ 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'?}}
+ r2->top_left.y = 0;
+ unsinged *ptr = 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}}
+ *ptr = 17;
+}