[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 02:45:13 PDT 2024


================
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK
+// RUN: %clang_cc1 -x c++ %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK-CXX
+
+union Foo {
+  struct Empty {} val;
+};
+
+union Foo foo = {};
+
+// CHECK: @foo = {{.*}}global %union.Foo undef, align 1
----------------
Michael137 wrote:

Moved it to `union-init2.c`. Looked like an appropriate place

https://github.com/llvm/llvm-project/pull/109271


More information about the cfe-commits mailing list