xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/atomic-aggregate-property.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10  -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10  -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
3*f4a2713aSLionel Sambuc// rdar: // 7849824
4*f4a2713aSLionel Sambuc// <rdar://problem/12547611>
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambucstruct s {
7*f4a2713aSLionel Sambuc  double a, b, c, d;
8*f4a2713aSLionel Sambuc};
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambucstruct s1 {
11*f4a2713aSLionel Sambuc    int i;
12*f4a2713aSLionel Sambuc    id j;
13*f4a2713aSLionel Sambuc    id k;
14*f4a2713aSLionel Sambuc};
15*f4a2713aSLionel Sambuc
16*f4a2713aSLionel Sambucstruct s2 {};
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc@interface A
19*f4a2713aSLionel Sambuc@property (readwrite) double x;
20*f4a2713aSLionel Sambuc@property (readwrite) struct s y;
21*f4a2713aSLionel Sambuc@property (nonatomic, readwrite) struct s1 z;
22*f4a2713aSLionel Sambuc@property (readwrite) struct s2 a;
23*f4a2713aSLionel Sambuc@end
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc@implementation A
26*f4a2713aSLionel Sambuc@synthesize x;
27*f4a2713aSLionel Sambuc@synthesize y;
28*f4a2713aSLionel Sambuc@synthesize z;
29*f4a2713aSLionel Sambuc@synthesize a;
30*f4a2713aSLionel Sambuc@end
31*f4a2713aSLionel Sambuc// CHECK-LP64: define internal double @"\01-[A x]"(
32*f4a2713aSLionel Sambuc// CHECK-LP64: load atomic i64* {{%.*}} unordered, align 8
33*f4a2713aSLionel Sambuc
34*f4a2713aSLionel Sambuc// CHECK-LP64: define internal void @"\01-[A setX:]"(
35*f4a2713aSLionel Sambuc// CHECK-LP64: store atomic i64 {{%.*}}, i64* {{%.*}} unordered, align 8
36*f4a2713aSLionel Sambuc
37*f4a2713aSLionel Sambuc// CHECK-LP64: define internal void @"\01-[A y]"(
38*f4a2713aSLionel Sambuc// CHECK-LP64: call void @objc_copyStruct(i8* {{%.*}}, i8* {{%.*}}, i64 32, i1 zeroext true, i1 zeroext false)
39*f4a2713aSLionel Sambuc
40*f4a2713aSLionel Sambuc// CHECK-LP64: define internal void @"\01-[A setY:]"(
41*f4a2713aSLionel Sambuc// CHECK-LP64: call void @objc_copyStruct(i8* {{%.*}}, i8* {{%.*}}, i64 32, i1 zeroext true, i1 zeroext false)
42*f4a2713aSLionel Sambuc
43*f4a2713aSLionel Sambuc// CHECK-LP64: define internal void @"\01-[A z]"(
44*f4a2713aSLionel Sambuc// CHECK-LP64: call i8* @objc_memmove_collectable(
45*f4a2713aSLionel Sambuc
46*f4a2713aSLionel Sambuc// CHECK-LP64: define internal void @"\01-[A setZ:]"(
47*f4a2713aSLionel Sambuc// CHECK-LP64: call i8* @objc_memmove_collectable(
48*f4a2713aSLionel Sambuc
49*f4a2713aSLionel Sambuc// CHECK-LP64: define internal void @"\01-[A a]"(
50*f4a2713aSLionel Sambuc// (do nothing)
51*f4a2713aSLionel Sambuc
52*f4a2713aSLionel Sambuc// CHECK-LP64: define internal void @"\01-[A setA:]"(
53*f4a2713aSLionel Sambuc// (do nothing)
54