John McCall | c5d9a90 | 2011-09-13 07:33:34 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -fobjc-nonfragile-abi -emit-llvm %s -o - | FileCheck %s |
| 2 | |
| 3 | // This structure's size is not a power of two, so the property does |
| 4 | // not get native atomics, even though x86-64 can do unaligned atomics |
| 5 | // with a lock prefix. |
| 6 | struct s3 { char c[3]; }; |
| 7 | |
| 8 | // This structure's size is, so it does, because it can. |
| 9 | struct s4 { char c[4]; }; |
| 10 | |
| 11 | @interface Test0 |
| 12 | @property struct s3 s3; |
| 13 | @property struct s4 s4; |
| 14 | @end |
| 15 | @implementation Test0 |
| 16 | @synthesize s3, s4; |
| 17 | @end |
| 18 | |
| 19 | // CHECK: define internal i24 @"\01-[Test0 s3]"( |
| 20 | // CHECK: call void @objc_copyStruct |
| 21 | |
| 22 | // CHECK: define internal void @"\01-[Test0 setS3:]"( |
| 23 | // CHECK: call void @objc_copyStruct |
| 24 | |
| 25 | // CHECK: define internal i32 @"\01-[Test0 s4]"( |
| 26 | // CHECK: load atomic i32* {{%.*}} unordered, align 1 |
| 27 | |
| 28 | // CHECK: define internal void @"\01-[Test0 setS4:]"( |
| 29 | // CHECK: store atomic i32 {{%.*}}, i32* {{%.*}} unordered, align 1 |