blob: 4089920b0925625b4d20c49045c2769631a9097c [file] [log] [blame]
John McCalld1e40d52011-10-02 01:16:38 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: grep objc_assign_global %t | count 3
3// RUN: grep objc_assign_strongCast %t | count 2
John McCalld1e40d52011-10-02 01:16:38 +00004// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s
Fariborz Jahanian27b7aa02010-05-20 18:22:28 +00005// RUN: grep objc_assign_global %t | count 3
6// RUN: grep objc_assign_strongCast %t | count 2
Fariborz Jahanian06b89122009-05-05 23:28:21 +00007
8@interface A
9@end
10
11typedef struct s0 {
12 A *a[4];
13} T;
14
15T g0;
16
17void f0(id x) {
18 g0.a[0] = x;
19}
20
21void f1(id x) {
22 ((T*) &g0)->a[0] = x;
23}
24
Fariborz Jahanian102e3902009-06-01 21:29:32 +000025void f2(unsigned idx)
26{
27 id *keys;
28 keys[idx] = 0;
29}
30