Debian Codegraph @

clang/test/CodeGenObjC/objc2-write-barrier-5.m

raw
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
2 // RUN: not grep objc_assign_ivar %t
3 // RUN: grep objc_assign_strongCast %t | count 8
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: not grep objc_assign_ivar %t
6 // RUN: grep objc_assign_strongCast %t | count 8
7
8 @interface TestUnarchiver
9 {
10 void *allUnarchivedObjects;
11 }
12 @end
13
14 @implementation TestUnarchiver
15
16 struct unarchive_list {
17 int ifield;
18 id *list;
19 };
20
21 - (id)init {
22 (*((struct unarchive_list *)allUnarchivedObjects)).list = 0;
23 ((struct unarchive_list *)allUnarchivedObjects)->list = 0;
24 (**((struct unarchive_list **)allUnarchivedObjects)).list = 0;
25 (*((struct unarchive_list **)allUnarchivedObjects))->list = 0;
26 return 0;
27 }
28
29 @end
30
31 @interface I
32 {
33 struct S {
34 id _timer;
35 } *p_animationState;
36 }
37 @end
38
39 @implementation I
40 - (void) Meth {
41 p_animationState->_timer = 0;
42 (*p_animationState)._timer = 0;
43 (&(*p_animationState))->_timer = 0;
44 }
45 @end