| 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s |
| 2 | // RUN: grep objc_assign_global %t | count 3 |
| 3 | // RUN: grep objc_assign_strongCast %t | count 2 |
| 4 | // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s |
| 5 | // RUN: grep objc_assign_global %t | count 3 |
| 6 | // RUN: grep objc_assign_strongCast %t | count 2 |
| 7 | |
| 8 | @interface A |
| 9 | @end |
| 10 | |
| 11 | typedef struct s0 { |
| 12 | A *a[4]; |
| 13 | } T; |
| 14 | |
| 15 | T g0; |
| 16 | |
| 17 | void f0(id x) { |
| 18 | g0.a[0] = x; |
| 19 | } |
| 20 | |
| 21 | void f1(id x) { |
| 22 | ((T*) &g0)->a[0] = x; |
| 23 | } |
| 24 | |
| 25 | void f2(unsigned idx) |
| 26 | { |
| 27 | id *keys; |
| 28 | keys[idx] = 0; |
| 29 | } |
| 30 | |
| 31 | |