62 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.nopch.ll %s2// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch -o %t.pch %s3// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.pch.ll %s -include-pch %t.pch4// REQUIRES: x86-registered-target5// RUN: diff %t.nopch.ll %t.pch.ll6 7#ifndef HEADER8#define HEADER9 10@interface NSArray11- (id)objectAtIndexedSubscript:(int)index;12+ (id)arrayWithObjects:(id *)objects count:(unsigned)count;13@end14 15@interface NSMutableArray : NSArray16- (void)setObject:(id)object atIndexedSubscript:(int)index;17@end18 19@interface NSDictionary20- (id)objectForKeyedSubscript:(id)key;21+ (id)dictionaryWithObjects:(id *)objects forKeys:(id *)keys count:(unsigned)count;22@end23 24@interface NSMutableDictionary : NSDictionary25- (void)setObject:(id)object forKeyedSubscript:(id)key;26@end27 28@interface NSNumber29+ (NSNumber *)numberWithInt:(int)value;30@end31 32@class NSString;33 34@interface NSValue35+ (NSValue *)valueWithBytes:(const void *)bytes objCType:(const char *)type;36@end37 38typedef struct __attribute__((objc_boxable)) _some_struct {39 int dummy;40} some_struct;41 42id testArray(int idx, id p) {43 NSMutableArray *array;44 array[idx] = p;45 NSArray *arr = @[ p, @7 ];46 return array[idx];47}48 49void testDict(NSString *key, id newObject, id oldObject) {50 NSMutableDictionary *dictionary;51 oldObject = dictionary[key];52 dictionary[key] = newObject;53 NSDictionary *dict = @{ key: newObject, key: oldObject };54}55 56void testBoxableValue(void) {57 some_struct ss;58 id value = @(ss);59}60 61#endif62