John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -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 |
John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s |
Fariborz Jahanian | 27b7aa0 | 2010-05-20 18:22:28 +0000 | [diff] [blame] | 5 | // RUN: grep objc_assign_global %t | count 3 |
| 6 | // RUN: grep objc_assign_strongCast %t | count 2 |
Fariborz Jahanian | 06b8912 | 2009-05-05 23:28:21 +0000 | [diff] [blame] | 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 | |
Fariborz Jahanian | 102e390 | 2009-06-01 21:29:32 +0000 | [diff] [blame] | 25 | void f2(unsigned idx) |
| 26 | { |
| 27 | id *keys; |
| 28 | keys[idx] = 0; |
| 29 | } |
| 30 | |