https://github.com/hongtaihu created https://github.com/llvm/llvm-project/pull/244100
This is a test-only cleanup. `dot-syntax.m` still disables its complex property coverage even though CodeGen has handled complex property LValues through ObjC getters and setters since r99299 (`3131496622ba`). The restored block exercises a `__complex int` property, its getter and setter, plain and compound assignment, and `SWAP` on the property value. I restored the original coverage with the explicit `__complex int` spelling. Validation: - An assertions-enabled managed-tip clang compiles the restored file with `-cc1 -emit-llvm` and emits the expected property getter/setter calls. - Historical check: parent `3968c6a2528e` fails with `LValue::getAddress(): Assertion 'isSimple()' failed`; the immediate child `3131496622ba` passes with the same frozen test. >From 69e3b89a21a51de0533fa37116d18b65809df3bd Mon Sep 17 00:00:00 2001 From: hongtaihu <[email protected]> Date: Thu, 19 Nov 2026 12:51:48 +0800 Subject: [PATCH] [Clang] Restore complex property dot-syntax coverage The disabled block in dot-syntax.m exercises complex ObjC properties, including plain and compound assignment through property getters and setters. Complex property compound assignment has been supported since r99299, and the restored test passes with an assertions-enabled clang. --- clang/test/CodeGenObjC/dot-syntax.m | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/clang/test/CodeGenObjC/dot-syntax.m b/clang/test/CodeGenObjC/dot-syntax.m index 411b0955aed414..78a97b9eab2221 100644 --- a/clang/test/CodeGenObjC/dot-syntax.m +++ b/clang/test/CodeGenObjC/dot-syntax.m @@ -13,12 +13,12 @@ -(id) init; @interface A : Root { int myX; - // __complex myY; + __complex int myY; S myZ; } @property int x; -//@property __complex int y; +@property __complex int y; @property S z; @end @@ -32,8 +32,6 @@ -(void) setX: (int) arg { printf("-[A setX: %d]\n", myX); } -// FIXME: Add back -#if 0 -(__complex int) y { printf("-[A y] = (%d, %d)\n", __real myY, __imag myY); return myY; @@ -42,7 +40,6 @@ -(void) setY: (__complex int) arg { myY = arg; printf("-[A setY: (%d, %d)]\n", __real myY, __imag myY); } -#endif -(S) z { printf("-[A z] = { %f, %f, { %f, %f } }\n", @@ -62,36 +59,36 @@ int main(void) { A *a = [[A alloc] init]; A *b = [[A alloc] init]; int a0 = 23; - // __complex a1 = 25 + 10i; + __complex int a1 = 25 + 10i; S a2 = { 246, 458, {275, 12} }; int b0 = 42673; - // __complex b1 = 15 + 13i; + __complex int b1 = 15 + 13i; S b2 = { 26, 2, {367, 13} }; a.x = a0; - // a.y = a1; + a.y = a1; a.z = a2; a.x += a0; - // a.y += a1; + a.y += a1; // Yay, no compound assign of structures. A GCC extension in the // works, perhaps? b.x = b0; - // b.y = b1; + b.y = b1; b.z = b2; int x0 = (b.x = b0); printf("(b.x = b0): %d\n", x0); - // int x1 = __real (b.y = b1); - // printf("__real (b.y = b1) = %d\n", x1); + int x1 = __real (b.y = b1); + printf("__real (b.y = b1) = %d\n", x1); float x2 = (b.z = b2).x; printf("(b.z = b2).x: %f\n", x2); SWAP(int, a.x, b.x); - // SWAP(__complex int, a.y, b.y); + SWAP(__complex int, a.y, b.y); SWAP(S, a.z, b.z); return 0; _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
