xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/misc-atomic-property.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10  -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5  -emit-llvm -o - %s | FileCheck %s
3*f4a2713aSLionel Sambuc// rdar: //8808439
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuctypedef struct {
6*f4a2713aSLionel Sambuc#ifdef __LP64__
7*f4a2713aSLionel Sambuc	unsigned char b[15];
8*f4a2713aSLionel Sambuc#else
9*f4a2713aSLionel Sambuc	unsigned char b[7];
10*f4a2713aSLionel Sambuc#endif
11*f4a2713aSLionel Sambuc} bools_minus_one;
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuctypedef struct {
14*f4a2713aSLionel Sambuc#ifdef __LP64__
15*f4a2713aSLionel Sambuc	unsigned char b[16];
16*f4a2713aSLionel Sambuc#else
17*f4a2713aSLionel Sambuc	unsigned char b[8];
18*f4a2713aSLionel Sambuc#endif
19*f4a2713aSLionel Sambuc} bools;
20*f4a2713aSLionel Sambuc
21*f4a2713aSLionel Sambuc
22*f4a2713aSLionel Sambuc@interface Foo
23*f4a2713aSLionel Sambuc{
24*f4a2713aSLionel Sambuc#ifndef __LP64__
25*f4a2713aSLionel Sambuc       bools x;
26*f4a2713aSLionel Sambuc       bools_minus_one y;
27*f4a2713aSLionel Sambuc#endif
28*f4a2713aSLionel Sambuc}
29*f4a2713aSLionel Sambuc@property(assign) bools bools_p;
30*f4a2713aSLionel Sambuc@property(assign) bools_minus_one bools_minus_one_p;
31*f4a2713aSLionel Sambuc@end
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc@implementation Foo
34*f4a2713aSLionel Sambuc@synthesize bools_p=x;
35*f4a2713aSLionel Sambuc@synthesize bools_minus_one_p=y;
36*f4a2713aSLionel Sambuc@end
37*f4a2713aSLionel Sambuc
38*f4a2713aSLionel Sambuc#ifdef __LP64__
39*f4a2713aSLionel Sambuctypedef __int128_t dword;
40*f4a2713aSLionel Sambuc#else
41*f4a2713aSLionel Sambuctypedef long long int dword;
42*f4a2713aSLionel Sambuc#endif
43*f4a2713aSLionel Sambuc
44*f4a2713aSLionel Sambuc@interface Test_dwords
45*f4a2713aSLionel Sambuc{
46*f4a2713aSLionel Sambuc#ifndef __LP64__
47*f4a2713aSLionel Sambuc       dword dw;
48*f4a2713aSLionel Sambuc#endif
49*f4a2713aSLionel Sambuc}
50*f4a2713aSLionel Sambuc@property(assign) dword dword_p;
51*f4a2713aSLionel Sambuc@end
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc@implementation Test_dwords
54*f4a2713aSLionel Sambuc@synthesize dword_p=dw;
55*f4a2713aSLionel Sambuc@end
56*f4a2713aSLionel Sambuc
57*f4a2713aSLionel Sambuc
58*f4a2713aSLionel Sambuc@interface Test_floats
59*f4a2713aSLionel Sambuc{
60*f4a2713aSLionel Sambuc  float fl;
61*f4a2713aSLionel Sambuc  double d;
62*f4a2713aSLionel Sambuc  long double ld;
63*f4a2713aSLionel Sambuc}
64*f4a2713aSLionel Sambuc@property(assign) float fl_p;
65*f4a2713aSLionel Sambuc@property(assign) double  d_p;
66*f4a2713aSLionel Sambuc@property(assign) long double ld_p;
67*f4a2713aSLionel Sambuc@end
68*f4a2713aSLionel Sambuc
69*f4a2713aSLionel Sambuc@implementation Test_floats
70*f4a2713aSLionel Sambuc@synthesize fl_p = fl;
71*f4a2713aSLionel Sambuc@synthesize d_p = d;
72*f4a2713aSLionel Sambuc@synthesize ld_p = ld;
73*f4a2713aSLionel Sambuc@end
74*f4a2713aSLionel Sambuc
75*f4a2713aSLionel Sambuc// CHECK: call void @objc_copyStruct
76*f4a2713aSLionel Sambuc// CHECK: call void @objc_copyStruct
77*f4a2713aSLionel Sambuc// CHECK: call void @objc_copyStruct
78*f4a2713aSLionel Sambuc// CHECK: call void @objc_copyStruct
79*f4a2713aSLionel Sambuc// CHECK: call void @objc_copyStruct
80*f4a2713aSLionel Sambuc// CHECK: call void @objc_copyStruct
81