From ad8524611846c34b89b0ff1e28b7c40f5b2038fc Mon Sep 17 00:00:00 2001 From: Nathan Lanza Date: Wed, 26 Nov 2025 03:08:21 -0800 Subject: [PATCH] Update [ghstack-poisoned] --- clang/lib/CIR/CodeGen/CIRGenModule.cpp | 4 ++- clang/test/CIR/CodeGen/multi-vtable.cpp | 24 ++++++------- clang/test/CIR/CodeGen/vbase.cpp | 16 ++++----- .../CodeGen/vtable-constant-divergence.cpp | 36 ------------------- clang/test/CIR/CodeGen/vtable-emission.cpp | 4 +-- clang/test/CIR/CodeGen/vtable-rtti.cpp | 8 ++--- clang/test/CIR/CodeGen/vtt.cpp | 6 ++-- 7 files changed, 32 insertions(+), 66 deletions(-) delete mode 100644 clang/test/CIR/CodeGen/vtable-constant-divergence.cpp diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index a45e6820cbf9..58d10d8cd66b 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -4050,7 +4050,9 @@ cir::GlobalOp CIRGenModule::createOrReplaceCXXRuntimeVariable( } // Create a new variable. - gv = CIRGenModule::createGlobalOp(*this, loc, name, ty); + // VTables and other C++ runtime variables should be constant. + gv = CIRGenModule::createGlobalOp(*this, loc, name, ty, + /*isConstant=*/true); // Set up extra information and add to the module gv.setLinkageAttr( diff --git a/clang/test/CIR/CodeGen/multi-vtable.cpp b/clang/test/CIR/CodeGen/multi-vtable.cpp index 7f3e9a4626f4..494bbf828c0a 100644 --- a/clang/test/CIR/CodeGen/multi-vtable.cpp +++ b/clang/test/CIR/CodeGen/multi-vtable.cpp @@ -83,16 +83,16 @@ int main() { // CIR: } // vtable for Mother -// CIR: cir.global linkonce_odr @_ZTV6Mother = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Mother> : !cir.ptr, #cir.global_view<@_ZN6Mother9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>}> : ![[VPtrTypeMother]] {alignment = 8 : i64} -// LLVM-DAG: @_ZTV6Mother = linkonce_odr global { [4 x ptr] } { [4 x ptr] [ptr null, ptr @_ZTI6Mother, ptr @_ZN6Mother9MotherFooEv, ptr @_ZN6Mother10MotherFoo2Ev] } +// CIR: cir.global constant linkonce_odr @_ZTV6Mother = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Mother> : !cir.ptr, #cir.global_view<@_ZN6Mother9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>}> : ![[VPtrTypeMother]] {alignment = 8 : i64} +// LLVM-DAG: @_ZTV6Mother = linkonce_odr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr @_ZTI6Mother, ptr @_ZN6Mother9MotherFooEv, ptr @_ZN6Mother10MotherFoo2Ev] } // vtable for __cxxabiv1::__class_type_info // CIR: cir.global "private" external @_ZTVN10__cxxabiv117__class_type_infoE : !cir.ptr> // LLVM-DAG: @_ZTVN10__cxxabiv117__class_type_infoE = external global ptr // typeinfo name for Mother -// CIR: cir.global linkonce_odr comdat @_ZTS6Mother = #cir.const_array<"6Mother" : !cir.array> : !cir.array {alignment = 1 : i64} -// LLVM-DAG: @_ZTS6Mother = linkonce_odr global [7 x i8] c"6Mother", comdat +// CIR: cir.global constant linkonce_odr comdat @_ZTS6Mother = #cir.const_array<"6Mother" : !cir.array> : !cir.array {alignment = 1 : i64} +// LLVM-DAG: @_ZTS6Mother = linkonce_odr constant [7 x i8] c"6Mother", comdat // typeinfo for Mother // Note: GEP emitted by cir might not be the same as LLVM, due to constant folding. @@ -100,24 +100,24 @@ int main() { // LLVM-DAG: @_ZTI6Mother = constant { ptr, ptr } { ptr getelementptr inbounds nuw (i8, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 16), ptr @_ZTS6Mother } // vtable for Father -// CIR: cir.global linkonce_odr @_ZTV6Father = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Father> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : ![[VPtrTypeFather]] {alignment = 8 : i64} -// LLVM-DAG: @_ZTV6Father = linkonce_odr global { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI6Father, ptr @_ZN6Father9FatherFooEv] } +// CIR: cir.global constant linkonce_odr @_ZTV6Father = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI6Father> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : ![[VPtrTypeFather]] {alignment = 8 : i64} +// LLVM-DAG: @_ZTV6Father = linkonce_odr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI6Father, ptr @_ZN6Father9FatherFooEv] } // vtable for Child -// CIR: cir.global linkonce_odr @_ZTV5Child = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN5Child9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr<-8 : i64> : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : ![[VPtrTypeChild]] {alignment = 8 : i64} -// LLVM-DAG: @_ZTV5Child = linkonce_odr global { [4 x ptr], [3 x ptr] } { [4 x ptr] [ptr null, ptr @_ZTI5Child, ptr @_ZN5Child9MotherFooEv, ptr @_ZN6Mother10MotherFoo2Ev], [3 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr @_ZTI5Child, ptr @_ZN6Father9FatherFooEv] } +// CIR: cir.global constant linkonce_odr @_ZTV5Child = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN5Child9MotherFooEv> : !cir.ptr, #cir.global_view<@_ZN6Mother10MotherFoo2Ev> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr<-8 : i64> : !cir.ptr, #cir.global_view<@_ZTI5Child> : !cir.ptr, #cir.global_view<@_ZN6Father9FatherFooEv> : !cir.ptr]> : !cir.array x 3>}> : ![[VPtrTypeChild]] {alignment = 8 : i64} +// LLVM-DAG: @_ZTV5Child = linkonce_odr constant { [4 x ptr], [3 x ptr] } { [4 x ptr] [ptr null, ptr @_ZTI5Child, ptr @_ZN5Child9MotherFooEv, ptr @_ZN6Mother10MotherFoo2Ev], [3 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr @_ZTI5Child, ptr @_ZN6Father9FatherFooEv] } // vtable for __cxxabiv1::__vmi_class_type_info // CIR: cir.global "private" external @_ZTVN10__cxxabiv121__vmi_class_type_infoE : !cir.ptr> // LLVM-DAG: @_ZTVN10__cxxabiv121__vmi_class_type_infoE = external global ptr // typeinfo name for Child -// CIR: cir.global linkonce_odr comdat @_ZTS5Child = #cir.const_array<"5Child" : !cir.array> : !cir.array {alignment = 1 : i64} -// LLVM-DAG: @_ZTS5Child = linkonce_odr global [6 x i8] c"5Child", comdat +// CIR: cir.global constant linkonce_odr comdat @_ZTS5Child = #cir.const_array<"5Child" : !cir.array> : !cir.array {alignment = 1 : i64} +// LLVM-DAG: @_ZTS5Child = linkonce_odr constant [6 x i8] c"5Child", comdat // typeinfo name for Father -// CIR: cir.global linkonce_odr comdat @_ZTS6Father = #cir.const_array<"6Father" : !cir.array> : !cir.array {alignment = 1 : i64} -// LLVM-DAG: @_ZTS6Father = linkonce_odr global [7 x i8] c"6Father", comdat +// CIR: cir.global constant linkonce_odr comdat @_ZTS6Father = #cir.const_array<"6Father" : !cir.array> : !cir.array {alignment = 1 : i64} +// LLVM-DAG: @_ZTS6Father = linkonce_odr constant [7 x i8] c"6Father", comdat // typeinfo for Father // Note: GEP emitted by cir might not be the same as LLVM, due to constant folding. diff --git a/clang/test/CIR/CodeGen/vbase.cpp b/clang/test/CIR/CodeGen/vbase.cpp index 120a63d1ea2e..c54433239a57 100644 --- a/clang/test/CIR/CodeGen/vbase.cpp +++ b/clang/test/CIR/CodeGen/vbase.cpp @@ -15,20 +15,20 @@ void ppp() { B b; } // Vtable definition for B -// CIR: cir.global linkonce_odr @_ZTV1B = #cir.vtable<{#cir.const_array<[#cir.ptr<12 : i64> : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1B> : !cir.ptr]> : !cir.array x 3>}> +// CIR: cir.global constant linkonce_odr @_ZTV1B = #cir.vtable<{#cir.const_array<[#cir.ptr<12 : i64> : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1B> : !cir.ptr]> : !cir.array x 3>}> // VTT for B. -// CIR: cir.global linkonce_odr @_ZTT1B = #cir.const_array<[#cir.global_view<@_ZTV1B, [0 : i32, 3 : i32]> : !cir.ptr]> : !cir.array x 1> +// CIR: cir.global constant linkonce_odr @_ZTT1B = #cir.const_array<[#cir.global_view<@_ZTV1B, [0 : i32, 3 : i32]> : !cir.ptr]> : !cir.array x 1> // CIR: cir.global "private" external @_ZTVN10__cxxabiv121__vmi_class_type_infoE // Type info name for B -// CIR: cir.global linkonce_odr comdat @_ZTS1B = #cir.const_array<"1B" : !cir.array> : !cir.array +// CIR: cir.global constant linkonce_odr comdat @_ZTS1B = #cir.const_array<"1B" : !cir.array> : !cir.array // CIR: cir.global "private" external @_ZTVN10__cxxabiv117__class_type_infoE : !cir.ptr> // Type info name for A -// CIR: cir.global linkonce_odr comdat @_ZTS1A = #cir.const_array<"1A" : !cir.array> : !cir.array +// CIR: cir.global constant linkonce_odr comdat @_ZTS1A = #cir.const_array<"1A" : !cir.array> : !cir.array // Type info A. // CIR: cir.global constant external @_ZTI1A = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr, #cir.global_view<@_ZTS1A> : !cir.ptr}> @@ -40,11 +40,11 @@ void ppp() { B b; } // LLVM: $_ZTS1A = comdat any // Note: GEP emitted by cir might not be the same as LLVM, due to constant folding. -// LLVM: @_ZTV1B = linkonce_odr global { [3 x ptr] } { [3 x ptr] [ptr inttoptr (i64 12 to ptr), ptr null, ptr @_ZTI1B] } -// LLVM: @_ZTT1B = linkonce_odr global [1 x ptr] [ptr getelementptr inbounds nuw (i8, ptr @_ZTV1B, i64 24)] +// LLVM: @_ZTV1B = linkonce_odr constant { [3 x ptr] } { [3 x ptr] [ptr inttoptr (i64 12 to ptr), ptr null, ptr @_ZTI1B] } +// LLVM: @_ZTT1B = linkonce_odr constant [1 x ptr] [ptr getelementptr inbounds nuw (i8, ptr @_ZTV1B, i64 24)] // LLVM: @_ZTVN10__cxxabiv121__vmi_class_type_infoE = external global ptr -// LLVM: @_ZTS1B = linkonce_odr global [2 x i8] c"1B", comdat +// LLVM: @_ZTS1B = linkonce_odr constant [2 x i8] c"1B", comdat // LLVM: @_ZTVN10__cxxabiv117__class_type_infoE = external global ptr -// LLVM: @_ZTS1A = linkonce_odr global [2 x i8] c"1A", comdat +// LLVM: @_ZTS1A = linkonce_odr constant [2 x i8] c"1A", comdat // LLVM: @_ZTI1A = constant { ptr, ptr } { ptr getelementptr inbounds nuw (i8, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 16), ptr @_ZTS1A } // LLVM: @_ZTI1B = constant { ptr, ptr, i32, i32, ptr, i64 } { ptr getelementptr inbounds nuw (i8, ptr @_ZTVN10__cxxabiv121__vmi_class_type_infoE, i64 16), ptr @_ZTS1B, i32 0, i32 1, ptr @_ZTI1A, i64 -6141 } diff --git a/clang/test/CIR/CodeGen/vtable-constant-divergence.cpp b/clang/test/CIR/CodeGen/vtable-constant-divergence.cpp deleted file mode 100644 index f2167162e3d0..000000000000 --- a/clang/test/CIR/CodeGen/vtable-constant-divergence.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll -// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t-codegen.ll -// RUN: FileCheck --check-prefix=CIR --input-file=%t-cir.ll %s -// RUN: FileCheck --check-prefix=CODEGEN --input-file=%t-codegen.ll %s - -// XFAIL: * - -// This test documents a divergence between CIR and CodeGen: -// CIR emits vtables as 'global' (mutable) instead of 'constant' (immutable). -// This is a bug that needs to be fixed. -// -// Expected (CodeGen): -// @_ZTV4Base = linkonce_odr unnamed_addr constant { [3 x ptr] } ... -// -// Actual (CIR): -// @_ZTV4Base = linkonce_odr global { [3 x ptr] } ... -// -// The vtable should be marked as 'constant' because: -// 1. Vtables are never modified at runtime -// 2. They should be placed in .rodata (read-only data section) -// 3. Writable vtables are a security vulnerability -// 4. CodeGen has always emitted them as constant - -class Base { -public: - virtual void foo() {} -}; - -void test() { - Base b; - b.foo(); -} - -// Both should emit vtable as constant -// CIR: @_ZTV4Base = linkonce_odr unnamed_addr constant -// CODEGEN: @_ZTV4Base = linkonce_odr unnamed_addr constant diff --git a/clang/test/CIR/CodeGen/vtable-emission.cpp b/clang/test/CIR/CodeGen/vtable-emission.cpp index 23cf684e4e25..e1b30ec6d340 100644 --- a/clang/test/CIR/CodeGen/vtable-emission.cpp +++ b/clang/test/CIR/CodeGen/vtable-emission.cpp @@ -15,8 +15,8 @@ void S::key() {} // CHECK-DAG: !rec_anon_struct2 = !cir.record}> // The definition of the key function should result in the vtable being emitted. -// CHECK: cir.global external @_ZTV1S = #cir.vtable -// LLVM: @_ZTV1S = global { [4 x ptr] } { [4 x ptr] +// CHECK: cir.global constant external @_ZTV1S = #cir.vtable +// LLVM: @_ZTV1S = constant { [4 x ptr] } { [4 x ptr] // LLVM-SAME: [ptr null, ptr @_ZTI1S, ptr @_ZN1S3keyEv, ptr @_ZN1S6nonKeyEv] }, align 8 // Note: GEP emitted by cir might not be the same as LLVM, due to constant folding. diff --git a/clang/test/CIR/CodeGen/vtable-rtti.cpp b/clang/test/CIR/CodeGen/vtable-rtti.cpp index 684608f3d52a..1f40bad2a018 100644 --- a/clang/test/CIR/CodeGen/vtable-rtti.cpp +++ b/clang/test/CIR/CodeGen/vtable-rtti.cpp @@ -64,7 +64,7 @@ class B : public A // CHECK: } // Vtable definition for A -// CHECK: cir.global "private" external @_ZTV1A : ![[VPtrTypeA]] {alignment = 8 : i64} +// CHECK: cir.global "private" constant external @_ZTV1A : ![[VPtrTypeA]] {alignment = 8 : i64} // A ctor => @A::A() // Calls @A::A() and initialize __vptr with address of A's vtable @@ -80,15 +80,15 @@ class B : public A // CHECK: } // vtable for B -// CHECK: cir.global linkonce_odr @_ZTV1B = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1B> : !cir.ptr, #cir.global_view<@_ZN1BD2Ev> : !cir.ptr, #cir.global_view<@_ZN1BD0Ev> : !cir.ptr, #cir.global_view<@_ZNK1A5quackEv> : !cir.ptr]> : !cir.array x 5>}> : ![[VPtrTypeA]] -// RTTI_DISABLED: cir.global linkonce_odr @_ZTV1B = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZN1BD2Ev> : !cir.ptr, #cir.global_view<@_ZN1BD0Ev> : !cir.ptr, #cir.global_view<@_ZNK1A5quackEv> : !cir.ptr]> : !cir.array x 5>}> : ![[VPtrTypeA]] +// CHECK: cir.global constant linkonce_odr @_ZTV1B = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1B> : !cir.ptr, #cir.global_view<@_ZN1BD2Ev> : !cir.ptr, #cir.global_view<@_ZN1BD0Ev> : !cir.ptr, #cir.global_view<@_ZNK1A5quackEv> : !cir.ptr]> : !cir.array x 5>}> : ![[VPtrTypeA]] +// RTTI_DISABLED: cir.global constant linkonce_odr @_ZTV1B = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZN1BD2Ev> : !cir.ptr, #cir.global_view<@_ZN1BD0Ev> : !cir.ptr, #cir.global_view<@_ZNK1A5quackEv> : !cir.ptr]> : !cir.array x 5>}> : ![[VPtrTypeA]] // vtable for __cxxabiv1::__si_class_type_info // CHECK: cir.global "private" external @_ZTVN10__cxxabiv120__si_class_type_infoE : !cir.ptr> // RTTI_DISABLED-NOT: cir.global "private" external @_ZTVN10__cxxabiv120__si_class_type_infoE : !cir.ptr> // typeinfo name for B -// CHECK: cir.global linkonce_odr comdat @_ZTS1B = #cir.const_array<"1B" : !cir.array> : !cir.array {alignment = 1 : i64} +// CHECK: cir.global constant linkonce_odr comdat @_ZTS1B = #cir.const_array<"1B" : !cir.array> : !cir.array {alignment = 1 : i64} // RTTI_DISABLED-NOT: cir.global linkonce_odr @_ZTS1B // typeinfo for A diff --git a/clang/test/CIR/CodeGen/vtt.cpp b/clang/test/CIR/CodeGen/vtt.cpp index 1983946115d2..bdbc1a262d81 100644 --- a/clang/test/CIR/CodeGen/vtt.cpp +++ b/clang/test/CIR/CodeGen/vtt.cpp @@ -34,7 +34,7 @@ int f() { } // Vtable of Class A -// CIR: cir.global linkonce_odr @_ZTV1A = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1A> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 3>}> : !rec_anon_struct3 {alignment = 8 : i64} +// CIR: cir.global constant linkonce_odr @_ZTV1A = #cir.vtable<{#cir.const_array<[#cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1A> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 3>}> : !rec_anon_struct3 {alignment = 8 : i64} // Class A constructor // CIR: cir.func linkonce_odr @_ZN1AC2Ev(%arg0: !cir.ptr @@ -44,9 +44,9 @@ int f() { // CIR: } // Vtable of Class D -// CIR: cir.global linkonce_odr @_ZTV1D = #cir.vtable<{#cir.const_array<[#cir.ptr<40 : i64> : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1B1wEv> : !cir.ptr, #cir.global_view<@_ZN1D1yEv> : !cir.ptr]> : !cir.array x 5>, #cir.const_array<[#cir.ptr<24 : i64> : !cir.ptr, #cir.ptr<-16 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1C1xEv> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr : !cir.ptr, #cir.ptr<-40 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 4>}> : !rec_anon_struct4 {alignment = 8 : i64} +// CIR: cir.global constant linkonce_odr @_ZTV1D = #cir.vtable<{#cir.const_array<[#cir.ptr<40 : i64> : !cir.ptr, #cir.ptr : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1B1wEv> : !cir.ptr, #cir.global_view<@_ZN1D1yEv> : !cir.ptr]> : !cir.array x 5>, #cir.const_array<[#cir.ptr<24 : i64> : !cir.ptr, #cir.ptr<-16 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1C1xEv> : !cir.ptr]> : !cir.array x 4>, #cir.const_array<[#cir.ptr : !cir.ptr, #cir.ptr<-40 : i64> : !cir.ptr, #cir.global_view<@_ZTI1D> : !cir.ptr, #cir.global_view<@_ZN1A1vEv> : !cir.ptr]> : !cir.array x 4>}> : !rec_anon_struct4 {alignment = 8 : i64} // VTT of class D -// CIR: cir.global linkonce_odr @_ZTT1D = #cir.const_array<[#cir.global_view<@_ZTV1D, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D0_1B, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D0_1B, [1 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D16_1C, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D16_1C, [1 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTV1D, [2 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTV1D, [1 : i32, 3 : i32]> : !cir.ptr]> : !cir.array x 7> {alignment = 8 : i64} +// CIR: cir.global constant linkonce_odr @_ZTT1D = #cir.const_array<[#cir.global_view<@_ZTV1D, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D0_1B, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D0_1B, [1 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D16_1C, [0 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTC1D16_1C, [1 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTV1D, [2 : i32, 3 : i32]> : !cir.ptr, #cir.global_view<@_ZTV1D, [1 : i32, 3 : i32]> : !cir.ptr]> : !cir.array x 7> {alignment = 8 : i64} // Class B constructor // CIR: cir.func linkonce_odr @_ZN1BC2Ev(%arg0: !cir.ptr