Fix the clang-wpa example.
[clang.git] / test / CodeGenObjC / property-aggr-type.m
blob8ba87de3534a7f1f2cc87b45af828ed57cebc46f
1 // RUN: %clang_cc1 -emit-llvm -o %t %s
3 @interface Object
4 - (id) new;
5 @end
7 typedef struct {int x, y, w, h;} st1;
8 typedef struct {int x, y, w, h;} st2;
10 @interface bar : Object
11 - (void)setFrame:(st1)frameRect;
12 @end
14 @interface bar1 : Object
15 - (void)setFrame:(int)frameRect;
16 @end
18 @interface foo : Object
20         st2 ivar;
22 @property (assign) st2 frame;
23 @end
25 @implementation foo
26 @synthesize frame = ivar;
27 @end
29 extern void abort();
31 static   st2 r = {1,2,3,4};
32 st2 test (void)
34     foo *obj = [foo new];
35     id objid = [foo new];;
37     obj.frame = r;
39     ((foo*)objid).frame = obj.frame;
41     return ((foo*)objid).frame;
44 int main ()
46   st2 res = test ();
47   if (res.x != 1 || res.h != 4)
48     abort();
49   return 0;