[clang] [llvm] [LLVMABI][AARCH64] Handle condtions for ignoring empty types (PR #224476)
Madhur Amilkanthwar via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 17 23:17:25 PDT 2026
================
@@ -165,3 +165,29 @@ HFAMatrix2 ret_hfa_matrix2() {
return r;
}
// CHECK: define{{.*}} %struct.HFAMatrix2 @ret_hfa_matrix2
+
+// Empty records and zero-size types are ignored as returns (void).
+typedef struct {
+} Empty;
+Empty ret_empty(void) {
+ Empty e;
+ return e;
+}
+// CHECK: define{{.*}} void @ret_empty()
+
+typedef union {
+} EmptyUnion;
+EmptyUnion ret_empty_union(void) {
+ EmptyUnion u;
+ return u;
+}
+// CHECK: define{{.*}} void @ret_empty_union()
+
+typedef struct {
----------------
madhur13490 wrote:
The .c argument test adds both ZeroSize and NestedZeroSize; this one only has ZeroSize. Worth adding the nested case for symmetry since it's two lines.
https://github.com/llvm/llvm-project/pull/224476
More information about the cfe-commits
mailing list