From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../Rewriter/rewrite-modern-container-literal.mm | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 clang/test/Rewriter/rewrite-modern-container-literal.mm (limited to 'clang/test/Rewriter/rewrite-modern-container-literal.mm') diff --git a/clang/test/Rewriter/rewrite-modern-container-literal.mm b/clang/test/Rewriter/rewrite-modern-container-literal.mm new file mode 100644 index 0000000..2c2f61d --- /dev/null +++ b/clang/test/Rewriter/rewrite-modern-container-literal.mm @@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -x objective-c++ -fms-extensions -rewrite-objc %s -o %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp +// rdar://10803676 + +void *sel_registerName(const char *); +typedef unsigned long NSUInteger; +typedef long NSInteger; +typedef bool BOOL; + +@interface NSNumber ++ (NSNumber *)numberWithChar:(char)value; ++ (NSNumber *)numberWithUnsignedChar:(unsigned char)value; ++ (NSNumber *)numberWithShort:(short)value; ++ (NSNumber *)numberWithUnsignedShort:(unsigned short)value; ++ (NSNumber *)numberWithInt:(int)value; ++ (NSNumber *)numberWithUnsignedInt:(unsigned int)value; ++ (NSNumber *)numberWithLong:(long)value; ++ (NSNumber *)numberWithUnsignedLong:(unsigned long)value; ++ (NSNumber *)numberWithLongLong:(long long)value; ++ (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value; ++ (NSNumber *)numberWithFloat:(float)value; ++ (NSNumber *)numberWithDouble:(double)value; ++ (NSNumber *)numberWithBool:(BOOL)value; ++ (NSNumber *)numberWithInteger:(NSInteger)value ; ++ (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value ; +@end + +@protocol NSCopying @end + +@interface NSDictionary ++ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(NSUInteger)cnt; +@end + +@interface NSArray ++ (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt; +@end + +@interface NSString +@end + +id NSUserName(); + +@interface NSDate ++ (id)date; +@end + +int main() { +NSArray *array = @[ @"Hello", NSUserName(), [NSDate date], [NSNumber numberWithInt:42]]; + +NSDictionary *dictionary = @{ @"name" : NSUserName(), @"date" : [NSDate date], @"process" : @"processInfo"}; + +NSDictionary *dict = @{ @"name":@666, @"man":@__objc_yes, @"date":@1.3 }; + +} + -- cgit v1.2.3