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