aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjC/property-aggr-type.m
blob: 263f76dda59c8a58e15ae3a77fdaa09537a57abd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// RUN: clang -cc1 -emit-llvm -o %t %s

@interface Object
- (id) new;
@end

typedef struct {int x, y, w, h;} st1;
typedef struct {int x, y, w, h;} st2;

@interface bar : Object
- (void)setFrame:(st1)frameRect;
@end

@interface bar1 : Object
- (void)setFrame:(int)frameRect;
@end

@interface foo : Object
{
	st2 ivar;
}
@property (assign) st2 frame;
@end

@implementation foo
@synthesize frame = ivar;
@end

extern void abort();

static   st2 r = {1,2,3,4};
st2 test (void)
{
    foo *obj = [foo new];
    id objid = [foo new];;

    obj.frame = r;

    ((foo*)objid).frame = obj.frame;

    return ((foo*)objid).frame;
}

int main ()
{
  st2 res = test ();
  if (res.x != 1 || res.h != 4)
    abort();
  return 0;
}