aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-05-30 22:41:32 +0000
committerJordan Rose <jordan_rose@apple.com>2012-05-30 22:41:32 +0000
commit2a53189a5186557640789ccb88da521047062674 (patch)
tree9e02cab0f85f3bab42fc56b3138574633bc47a5d
parent153acdb7310b20a72e608cbb10946621f161eb70 (diff)
Add a test for '%@' suggestion for classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157718 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/FixIt/format.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/FixIt/format.m b/test/FixIt/format.m
index d412b8dbfc..d9589a0148 100644
--- a/test/FixIt/format.m
+++ b/test/FixIt/format.m
@@ -68,3 +68,14 @@ void test_block_correction (block_t x) {
// CHECK: fix-it:"{{.*}}":{64:11-64:13}:"%@"
// CHECK: fix-it:"{{.*}}":{65:11-65:14}:"%@"
}
+
+void test_class_correction (Class x) {
+ NSLog(@"%d", x); // expected-warning{{format specifies type 'int' but the argument has type 'Class'}}
+ NSLog(@"%s", x); // expected-warning{{format specifies type 'char *' but the argument has type 'Class'}}
+ NSLog(@"%lf", x); // expected-warning{{format specifies type 'double' but the argument has type 'Class'}}
+ NSLog(@"%@", x); // no-warning
+ // CHECK: fix-it:"{{.*}}":{73:11-73:13}:"%@"
+ // CHECK: fix-it:"{{.*}}":{74:11-74:13}:"%@"
+ // CHECK: fix-it:"{{.*}}":{75:11-75:14}:"%@"
+}
+