diff options
Diffstat (limited to 'clang/test/SemaObjC')
| -rw-r--r-- | clang/test/SemaObjC/format-strings-objc-fixit.m | 31 | ||||
| -rw-r--r-- | clang/test/SemaObjC/format-strings-objc.m | 1 |
2 files changed, 1 insertions, 31 deletions
diff --git a/clang/test/SemaObjC/format-strings-objc-fixit.m b/clang/test/SemaObjC/format-strings-objc-fixit.m deleted file mode 100644 index feaebeec57f..00000000000 --- a/clang/test/SemaObjC/format-strings-objc-fixit.m +++ /dev/null @@ -1,31 +0,0 @@ -// RUN: cp %s %t -// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin -Wno-objc-root-class -pedantic -Wall -fixit %t -// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin -Wno-objc-root-class -fsyntax-only -pedantic -Wall -Werror %t -// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin -Wno-objc-root-class -E -o - %t | FileCheck %s - -typedef signed char BOOL; -typedef unsigned int NSUInteger; -typedef struct _NSZone NSZone; -@class NSCoder, NSString, NSEnumerator; -@protocol NSObject - (BOOL)isEqual:(id)object; @end -@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end -@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end -@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end -@interface NSObject <NSObject> {} @end -@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length; @end -extern void NSLog(NSString *format, ...); - -/* This is a test of the various code modification hints that are - provided as part of warning or extension diagnostics. All of the - warnings will be fixed by -fixit, and the resulting file should - compile cleanly with -Werror -pedantic. */ - -extern NSString *NonliteralString; - -void test() { - // nonliteral format - NSLog(NonliteralString); -} - -// Validate the fixes. -// CHECK: NSLog(@"%@", NonliteralString); diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m index 079460cc76c..a1ebf03f8ef 100644 --- a/clang/test/SemaObjC/format-strings-objc.m +++ b/clang/test/SemaObjC/format-strings-objc.m @@ -116,6 +116,7 @@ NSString *test_literal_propagation(void) { NSLog(ns2); // expected-warning {{more '%' conversions than data arguments}} NSString * ns3 = ns1; NSLog(ns3); // expected-warning {{format string is not a string literal}}} + // expected-note@-1{{treat the string as an argument to avoid this}} NSString * const ns6 = @"split" " string " @"%s"; // expected-note {{format string is defined here}} NSLog(ns6); // expected-warning {{more '%' conversions than data arguments}} |

