[cfe-commits] r157718 - /cfe/trunk/test/FixIt/format.m
Jordan Rose
jordan_rose at apple.com
Wed May 30 15:41:32 PDT 2012
Author: jrose
Date: Wed May 30 17:41:32 2012
New Revision: 157718
URL: http://llvm.org/viewvc/llvm-project?rev=157718&view=rev
Log:
Add a test for '%@' suggestion for classes.
Modified:
cfe/trunk/test/FixIt/format.m
Modified: cfe/trunk/test/FixIt/format.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/format.m?rev=157718&r1=157717&r2=157718&view=diff
==============================================================================
--- cfe/trunk/test/FixIt/format.m (original)
+++ cfe/trunk/test/FixIt/format.m Wed May 30 17:41:32 2012
@@ -68,3 +68,14 @@
// 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}:"%@"
+}
+
More information about the cfe-commits
mailing list