diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-01-30 00:56:00 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-01-30 00:56:00 +0000 |
commit | f7066acc5061e3587ebbd3108f3b1c554bf692a4 (patch) | |
tree | e7de5af61e4675307b01b0b39f956ec79a8274e6 | |
parent | d635c5fcc45c952b75743dd2f4c86d6950e4954e (diff) |
Add test case for <rdar://problem/7068334> (which was fixed by r94864).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94865 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaObjC/format-strings-objc.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaObjC/format-strings-objc.m b/test/SemaObjC/format-strings-objc.m index df52076582..7abfe96223 100644 --- a/test/SemaObjC/format-strings-objc.m +++ b/test/SemaObjC/format-strings-objc.m @@ -29,6 +29,8 @@ extern void *_NSConstantStringClassReference; typedef const struct __CFString * CFStringRef; extern void CFStringCreateWithFormat(CFStringRef format, ...) __attribute__((format(CFString, 1, 2))); +int printf(const char * restrict, ...) ; + //===----------------------------------------------------------------------===// // Test cases. //===----------------------------------------------------------------------===// @@ -41,3 +43,10 @@ void check_nslog(unsigned k) { // Check type validation extern void NSLog2(int format, ...) __attribute__((format(__NSString__, 1, 2))); // expected-error {{format argument not an NSString}} extern void CFStringCreateWithFormat2(int *format, ...) __attribute__((format(CFString, 1, 2))); // expected-error {{format argument not a CFString}} + +// <rdar://problem/7068334> - Catch use of long long with int arguments. +void rdar_7068334() { + long long test = 500; + printf("%i ",test); // expected-warning{{conversion specifies type 'int' but the argument has type 'long long'}} + NSLog(@"%i ",test); // expected-warning{{conversion specifies type 'int' but the argument has type 'long long'}} +} |