Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 2 | // RUN: grep objc_assign_global %t | count 3 |
| 3 | // RUN: grep objc_assign_strongCast %t | count 2 |
Fariborz Jahanian | 06b8912 | 2009-05-05 23:28:21 +0000 | [diff] [blame] | 4 | |
| 5 | @interface A |
| 6 | @end |
| 7 | |
| 8 | typedef struct s0 { |
| 9 | A *a[4]; |
| 10 | } T; |
| 11 | |
| 12 | T g0; |
| 13 | |
| 14 | void f0(id x) { |
| 15 | g0.a[0] = x; |
| 16 | } |
| 17 | |
| 18 | void f1(id x) { |
| 19 | ((T*) &g0)->a[0] = x; |
| 20 | } |
| 21 | |
Fariborz Jahanian | 102e390 | 2009-06-01 21:29:32 +0000 | [diff] [blame] | 22 | void f2(unsigned idx) |
| 23 | { |
| 24 | id *keys; |
| 25 | keys[idx] = 0; |
| 26 | } |
| 27 | |