blob: 027f6d6326863a7f2ecd840d8150949016fcc1b9 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
2// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
Daniel Dunbar42f963d2009-06-10 04:38:50 +00003
4@interface I0 {
5@public
6 _Complex float iv0;
7}
8
9@property(assign) _Complex float p0;
10
11-(_Complex float) im0;
12-(void) setIm0: (_Complex float) a0;
13@end
14
15@implementation I0
16@dynamic p0;
17
18-(id) init {
19 self->iv0 = 5.0 + 2.0i;
20 return self;
21}
22
23-(_Complex float) im0 {
24 printf("im0: %.2f + %.2fi\n", __real iv0, __imag iv0);
25 return iv0 + (.1 + .2i);
26}
27-(void) setIm0: (_Complex float) a0 {
28 printf("setIm0: %.2f + %.2fi\n", __real a0, __imag a0);
29 iv0 = a0 + (.3 + .4i);
30}
31
32-(_Complex float) p0 {
33 printf("p0: %.2f + %.2fi\n", __real iv0, __imag iv0);
34 return iv0 + (.5 + .6i);
35}
36-(void) setP0: (_Complex float) a0 {
37 printf("setP0: %.2f + %.2fi\n", __real a0, __imag a0);
38 iv0 = a0 + (.7 + .8i);
39}
40@end
41
42void f0(I0 *a0) {
43 float l0 = __real a0.im0;
44 float l1 = __imag a0->iv0;
45 _Complex float l2 = (a0.im0 = a0.im0);
46 _Complex float l3 = a0->iv0;
47 _Complex float l4 = (a0->iv0 = a0->iv0);
48 _Complex float l5 = a0->iv0;
49 _Complex float l6 = (a0.p0 = a0.p0);
50 _Complex float l7 = a0->iv0;
51 _Complex float l8 = [a0 im0];
52 printf("l0: %.2f + %.2fi\n", __real l0, __imag l0);
53 printf("l1: %.2f + %.2fi\n", __real l1, __imag l1);
54 printf("l2: %.2f + %.2fi\n", __real l2, __imag l2);
55 printf("l3: %.2f + %.2fi\n", __real l3, __imag l3);
56 printf("l4: %.2f + %.2fi\n", __real l4, __imag l4);
57 printf("l5: %.2f + %.2fi\n", __real l5, __imag l5);
58 printf("l6: %.2f + %.2fi\n", __real l6, __imag l6);
59 printf("l7: %.2f + %.2fi\n", __real l7, __imag l7);
60 printf("l8: %.2f + %.2fi\n", __real l8, __imag l8);
61}