blob: 2c2f61df1d496acc51a28b7ff2f2f24a789ee7bc [file] [log] [blame]
Fariborz Jahaniane35abe12012-04-06 22:29:36 +00001// RUN: %clang_cc1 -x objective-c++ -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3// rdar://10803676
4
5void *sel_registerName(const char *);
Fariborz Jahanianf7ef9312012-04-06 22:51:48 +00006typedef unsigned long NSUInteger;
7typedef long NSInteger;
Fariborz Jahanian93a49942012-04-16 21:03:30 +00008typedef bool BOOL;
Fariborz Jahaniane35abe12012-04-06 22:29:36 +00009
10@interface NSNumber
11+ (NSNumber *)numberWithChar:(char)value;
Fariborz Jahanianf7ef9312012-04-06 22:51:48 +000012+ (NSNumber *)numberWithUnsignedChar:(unsigned char)value;
13+ (NSNumber *)numberWithShort:(short)value;
14+ (NSNumber *)numberWithUnsignedShort:(unsigned short)value;
Fariborz Jahaniane35abe12012-04-06 22:29:36 +000015+ (NSNumber *)numberWithInt:(int)value;
Fariborz Jahanianf7ef9312012-04-06 22:51:48 +000016+ (NSNumber *)numberWithUnsignedInt:(unsigned int)value;
17+ (NSNumber *)numberWithLong:(long)value;
18+ (NSNumber *)numberWithUnsignedLong:(unsigned long)value;
19+ (NSNumber *)numberWithLongLong:(long long)value;
20+ (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value;
21+ (NSNumber *)numberWithFloat:(float)value;
22+ (NSNumber *)numberWithDouble:(double)value;
23+ (NSNumber *)numberWithBool:(BOOL)value;
24+ (NSNumber *)numberWithInteger:(NSInteger)value ;
25+ (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value ;
Fariborz Jahaniane35abe12012-04-06 22:29:36 +000026@end
27
28@protocol NSCopying @end
Fariborz Jahaniane35abe12012-04-06 22:29:36 +000029
30@interface NSDictionary
31+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
32@end
33
34@interface NSArray
35+ (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
36@end
37
38@interface NSString<NSCopying>
39@end
40
41id NSUserName();
42
43@interface NSDate
44+ (id)date;
45@end
46
47int main() {
48NSArray *array = @[ @"Hello", NSUserName(), [NSDate date], [NSNumber numberWithInt:42]];
49
50NSDictionary *dictionary = @{ @"name" : NSUserName(), @"date" : [NSDate date], @"process" : @"processInfo"};
Fariborz Jahanianf7ef9312012-04-06 22:51:48 +000051
52NSDictionary *dict = @{ @"name":@666, @"man":@__objc_yes, @"date":@1.3 };
53
Fariborz Jahaniane35abe12012-04-06 22:29:36 +000054}
55