summaryrefslogtreecommitdiff
path: root/test/FixIt
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-03-25 22:28:37 +0000
committerTed Kremenek <kremenek@apple.com>2013-03-25 22:28:37 +0000
commit6edb029026d290f12393ed8389a3e1de596c77ec (patch)
tree1032a8f8fe36ed413f7c94e150613e703b325be5 /test/FixIt
parentabde2c7f2c0699c7db395166f4e89b80bb87bf67 (diff)
downloadclang-6edb029026d290f12393ed8389a3e1de596c77ec.tar.gz
For printf checking, handle nested typedefs for darwin-specific checking.
Fixes <rdar://problem/13491605>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt')
-rw-r--r--test/FixIt/format-darwin.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/FixIt/format-darwin.m b/test/FixIt/format-darwin.m
index cfaac29e90..79a3b388e7 100644
--- a/test/FixIt/format-darwin.m
+++ b/test/FixIt/format-darwin.m
@@ -23,6 +23,8 @@ typedef long SInt32;
typedef unsigned long UInt32;
#endif
+typedef SInt32 OSStatus;
+
NSInteger getNSInteger();
NSUInteger getNSUInteger();
SInt32 getSInt32();
@@ -210,3 +212,9 @@ void testCapitals() {
// CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:13-[[@LINE-3]]:14}:"d"
// CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:11-[[@LINE-4]]:14}:"%D"
}
+
+void testLayeredTypedefs(OSStatus i) {
+ printf("%s", i); // expected-warning {{values of type 'OSStatus' should not be used as format arguments}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"d"
+}
+