Ted Kremenek | ebcb57a | 2012-03-06 20:05:56 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.nopch.ll %s |
| 2 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch -o %t.pch %s |
| 3 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.pch.ll %s -include-pch %t.pch |
| 4 | // RUN: diff %t.nopch.ll %t.pch.ll |
| 5 | |
| 6 | #ifndef HEADER |
| 7 | #define HEADER |
| 8 | |
| 9 | @interface NSArray |
| 10 | - (id)objectAtIndexedSubscript:(int)index; |
| 11 | + (id)arrayWithObjects:(id *)objects count:(unsigned)count; |
| 12 | @end |
| 13 | |
| 14 | @interface NSMutableArray : NSArray |
| 15 | - (void)setObject:(id)object atIndexedSubscript:(int)index; |
| 16 | @end |
| 17 | |
| 18 | @interface NSDictionary |
| 19 | - (id)objectForKeyedSubscript:(id)key; |
| 20 | + (id)dictionaryWithObjects:(id *)objects forKeys:(id *)keys count:(unsigned)count; |
| 21 | @end |
| 22 | |
| 23 | @interface NSMutableDictionary : NSDictionary |
| 24 | - (void)setObject:(id)object forKeyedSubscript:(id)key; |
| 25 | @end |
| 26 | |
| 27 | @interface NSNumber |
| 28 | + (NSNumber *)numberWithInt:(int)value; |
| 29 | @end |
| 30 | |
| 31 | @class NSString; |
| 32 | |
| 33 | id testArray(int idx, id p) { |
| 34 | NSMutableArray *array; |
| 35 | array[idx] = p; |
| 36 | NSArray *arr = @[ p, @7 ]; |
| 37 | return array[idx]; |
| 38 | } |
| 39 | |
| 40 | void testDict(NSString *key, id newObject, id oldObject) { |
| 41 | NSMutableDictionary *dictionary; |
| 42 | oldObject = dictionary[key]; |
| 43 | dictionary[key] = newObject; |
| 44 | NSDictionary *dict = @{ key: newObject, key: oldObject }; |
| 45 | } |
| 46 | |
| 47 | #endif |