Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -triple x86_64-apple-darwin10 -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 | ||||
Fariborz Jahanian | 06b8912 | 2009-05-05 23:28:21 +0000 | [diff] [blame] | 4 | // RUN: true |
5 | |||||
6 | @interface A | ||||
7 | @end | ||||
8 | |||||
9 | typedef struct s0 { | ||||
10 | A *a[4]; | ||||
11 | } T; | ||||
12 | |||||
13 | T g0; | ||||
14 | |||||
15 | void f0(id x) { | ||||
16 | g0.a[0] = x; | ||||
17 | } | ||||
18 | |||||
19 | void f1(id x) { | ||||
20 | ((T*) &g0)->a[0] = x; | ||||
21 | } | ||||
22 | |||||
Fariborz Jahanian | 102e390 | 2009-06-01 21:29:32 +0000 | [diff] [blame] | 23 | void f2(unsigned idx) |
24 | { | ||||
25 | id *keys; | ||||
26 | keys[idx] = 0; | ||||
27 | } | ||||
28 |