1 // RUN: %clang_cc1 -emit-llvm -o %t %s
3 int printf(const char *, ...);
21 //@property __complex int y;
27 printf("-[A x] = %d\n", myX);
30 -(void) setX: (int) arg {
32 printf("-[A setX: %d]\n", myX);
38 printf("-[A y] = (%d, %d)\n", __real myY, __imag myY);
41 -(void) setY: (__complex int) arg {
43 printf("-[A setY: (%d, %d)]\n", __real myY, __imag myY);
48 printf("-[A z] = { %f, %f, { %f, %f } }\n",
49 myZ.x, myZ.y, myZ.z[0], myZ.z[1]);
52 -(void) setZ: (S) arg {
54 printf("-[A setZ: { %f, %f, { %f, %f } } ]\n",
55 myZ.x, myZ.y, myZ.z[0], myZ.z[1]);
61 #define SWAP(T,a,b) { T a_tmp = a; a = b; b = a_tmp; }
62 A *a = [[A alloc] init];
63 A *b = [[A alloc] init];
65 // __complex a1 = 25 + 10i;
66 S a2 = { 246, 458, {275, 12} };
68 // __complex b1 = 15 + 13i;
69 S b2 = { 26, 2, {367, 13} };
77 // Yay, no compound assign of structures. A GCC extension in the
85 printf("(b.x = b0): %d\n", x0);
87 // int x1 = __real (b.y = b1);
88 // printf("__real (b.y = b1) = %d\n", x1);
90 float x2 = (b.z = b2).x;
91 printf("(b.z = b2).x: %f\n", x2);
94 // SWAP(__complex int, a.y, b.y);