[libcxx-commits] [libcxx] [AIX][libc++] Fix sized_delete.pass.cpp for AIX by adding -fsized-deallocation flag (PR #199366)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 23 11:30:20 PDT 2026


https://github.com/Himadhith created https://github.com/llvm/llvm-project/pull/199366

By default `-fno-sized-deallocation` is passed for libc++ in AIX.  https://github.com/llvm/llvm-project/blob/47e6290a34507ba1b3f4e0a49bad28982ff3e3ef/clang/lib/Driver/ToolChains/AIX.cpp#L578

As many other targets have passed the argument through `ADDITIONAL_COMPILE_FLAGS` using the same for PPC. 
`ADDITIONAL_COMPILE_FLAGS` does not take regex so the full name of targets are used for 32 and 64 bits. 

>From b5054263cad8a7fb7122a775b146d8dfe8089769 Mon Sep 17 00:00:00 2001
From: himadhith <himadhith.v at ibm.com>
Date: Sat, 23 May 2026 14:23:54 -0400
Subject: [PATCH] [AIX][libc++] Fix sized_delete.pass.cpp for AIX by adding
 -fsized-deallocation flag

---
 .../new.delete/new.delete.array/sized_delete_array.pass.cpp  | 5 +++--
 .../new.delete/new.delete.single/sized_delete.pass.cpp       | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp
index 21bad089ff34d..93bf45b14686f 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp
@@ -17,11 +17,12 @@
 // ADDITIONAL_COMPILE_FLAGS(target=aarch64-w64-windows-gnu): -fsized-deallocation
 // ADDITIONAL_COMPILE_FLAGS(target=armv7-w64-windows-gnu): -fsized-deallocation
 // ADDITIONAL_COMPILE_FLAGS(target=arm64ec-w64-windows-gnu): -fsized-deallocation
-
+// ADDITIONAL_COMPILE_FLAGS(target=powerpc-ibm-aix7.2.5.11): -fsized-deallocation
+// ADDITIONAL_COMPILE_FLAGS(target=powerpc64-ibm-aix7.2.5.11): -fsized-deallocation
 // UNSUPPORTED: sanitizer-new-delete
 
 // AIX, and z/OS default to -fno-sized-deallocation.
-// XFAIL: target={{.+}}-aix{{.*}}, target={{.+}}-zos{{.*}}
+// XFAIL: target={{.+}}-zos{{.*}}
 
 #if !defined(__cpp_sized_deallocation)
 # error __cpp_sized_deallocation should be defined
diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp
index 0c0896e299f4e..aa1ca89924344 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp
@@ -17,11 +17,12 @@
 // ADDITIONAL_COMPILE_FLAGS(target=aarch64-w64-windows-gnu): -fsized-deallocation
 // ADDITIONAL_COMPILE_FLAGS(target=armv7-w64-windows-gnu): -fsized-deallocation
 // ADDITIONAL_COMPILE_FLAGS(target=arm64ec-w64-windows-gnu): -fsized-deallocation
-
+// ADDITIONAL_COMPILE_FLAGS(target=powerpc-ibm-aix7.2.5.11): -fsized-deallocation
+// ADDITIONAL_COMPILE_FLAGS(target=powerpc64-ibm-aix7.2.5.11): -fsized-deallocation
 // UNSUPPORTED: sanitizer-new-delete
 
 // AIX, and z/OS default to -fno-sized-deallocation.
-// XFAIL: target={{.+}}-aix{{.*}}, target={{.+}}-zos{{.*}}
+// XFAIL: target={{.+}}-zos{{.*}}
 
 #if !defined(__cpp_sized_deallocation)
 # error __cpp_sized_deallocation should be defined



More information about the libcxx-commits mailing list