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