xref: /aosp_15_r20/external/clang/test/CodeGenObjC/property-aggregate.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s
2*67e74705SXin Li
3*67e74705SXin Li// This structure's size is not a power of two, so the property does
4*67e74705SXin Li// not get native atomics, even though x86-64 can do unaligned atomics
5*67e74705SXin Li// with a lock prefix.
6*67e74705SXin Listruct s3 { char c[3]; };
7*67e74705SXin Li
8*67e74705SXin Li// This structure's size is, so it does, because it can.
9*67e74705SXin Li// FIXME: But we don't at the moment; the backend doesn't know how to generate
10*67e74705SXin Li// correct code.
11*67e74705SXin Listruct s4 { char c[4]; };
12*67e74705SXin Li
13*67e74705SXin Li@interface Test0
14*67e74705SXin Li@property struct s3 s3;
15*67e74705SXin Li@property struct s4 s4;
16*67e74705SXin Li@end
17*67e74705SXin Li@implementation Test0
18*67e74705SXin Li@synthesize s3, s4;
19*67e74705SXin Li@end
20*67e74705SXin Li
21*67e74705SXin Li// CHECK: define internal i24 @"\01-[Test0 s3]"(
22*67e74705SXin Li// CHECK: call void @objc_copyStruct
23*67e74705SXin Li
24*67e74705SXin Li// CHECK: define internal void @"\01-[Test0 setS3:]"(
25*67e74705SXin Li// CHECK: call void @objc_copyStruct
26*67e74705SXin Li
27*67e74705SXin Li// CHECK: define internal i32 @"\01-[Test0 s4]"(
28*67e74705SXin Li// CHECK: call void @objc_copyStruct
29*67e74705SXin Li
30*67e74705SXin Li// CHECK: define internal void @"\01-[Test0 setS4:]"(
31*67e74705SXin Li// CHECK: call void @objc_copyStruct
32