xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/property-agrr-getter.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -emit-llvm-only %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuctypedef struct {
4*f4a2713aSLionel Sambuc  unsigned f0;
5*f4a2713aSLionel Sambuc} s0;
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc@interface A
8*f4a2713aSLionel Sambuc- (s0) f0;
9*f4a2713aSLionel Sambuc@end
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc@implementation A
12*f4a2713aSLionel Sambuc-(s0) f0{ while (1) {} }
13*f4a2713aSLionel Sambuc- (unsigned) bar {
14*f4a2713aSLionel Sambuc  return self.f0.f0;
15*f4a2713aSLionel Sambuc}
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuctypedef struct _NSSize {
20*f4a2713aSLionel Sambuc    float width;
21*f4a2713aSLionel Sambuc    float height;
22*f4a2713aSLionel Sambuc} NSSize;
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc@interface AnObject
26*f4a2713aSLionel Sambuc{
27*f4a2713aSLionel Sambuc NSSize size;
28*f4a2713aSLionel Sambuc}
29*f4a2713aSLionel Sambuc
30*f4a2713aSLionel Sambuc@property NSSize size;
31*f4a2713aSLionel Sambuc
32*f4a2713aSLionel Sambuc@end
33*f4a2713aSLionel Sambuc
34*f4a2713aSLionel Sambucfloat f ()
35*f4a2713aSLionel Sambuc{
36*f4a2713aSLionel Sambuc  AnObject* obj;
37*f4a2713aSLionel Sambuc  return (obj.size).width;
38*f4a2713aSLionel Sambuc}
39*f4a2713aSLionel Sambuc
40*f4a2713aSLionel Sambuc// rdar://problem/9272392
41*f4a2713aSLionel Sambucvoid test3(AnObject *obj) {
42*f4a2713aSLionel Sambuc  obj.size;
43*f4a2713aSLionel Sambuc  (void) obj.size;
44*f4a2713aSLionel Sambuc}
45