[clang] a8a988b - [CIR]Fix CIR Test failures after unnamed_addr removed from vtables (#200435)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 29 09:07:32 PDT 2026
Author: Erich Keane
Date: 2026-05-29T09:07:27-07:00
New Revision: a8a988bd6a5be1d58402a66613814afcb60ef920
URL: https://github.com/llvm/llvm-project/commit/a8a988bd6a5be1d58402a66613814afcb60ef920
DIFF: https://github.com/llvm/llvm-project/commit/a8a988bd6a5be1d58402a66613814afcb60ef920.diff
LOG: [CIR]Fix CIR Test failures after unnamed_addr removed from vtables (#200435)
See #200108 and #197855 for the cause. We weren't generating this
anywhere in our code, so it is only OGCG check lines that got changed.
Added:
Modified:
clang/test/CIR/CodeGen/multi-vtable.cpp
clang/test/CIR/CodeGen/thunks.cpp
clang/test/CIR/CodeGen/vbase.cpp
clang/test/CIR/CodeGen/virtual-function-calls.cpp
clang/test/CIR/CodeGen/vtable-emission.cpp
clang/test/CIR/CodeGen/vtable-linkage-explicit-instantiation.cpp
clang/test/CIR/CodeGen/vtt.cpp
clang/test/CIR/CodeGenCXX/vtable-linkage.cpp
Removed:
################################################################################
diff --git a/clang/test/CIR/CodeGen/multi-vtable.cpp b/clang/test/CIR/CodeGen/multi-vtable.cpp
index 8f5b8b38eb3a6..7227bf8ba13c0 100644
--- a/clang/test/CIR/CodeGen/multi-vtable.cpp
+++ b/clang/test/CIR/CodeGen/multi-vtable.cpp
@@ -67,7 +67,7 @@ void Child::MotherKey() {}
// LLVM-SAME: ]
// LLVM-SAME: }
-// OGCG: @_ZTV5Child = unnamed_addr constant { [4 x ptr], [3 x ptr] } {
+// OGCG: @_ZTV5Child = constant { [4 x ptr], [3 x ptr] } {
// OGCG-SAME: [4 x ptr] [
// OGCG-SAME: ptr null,
// OGCG-SAME: ptr null,
@@ -101,7 +101,7 @@ void Child::MotherKey() {}
// LLVM-SAME: ]
// LLVM-SAME: }
-// OGCG: @_ZTV6Mother = unnamed_addr constant { [4 x ptr] } {
+// OGCG: @_ZTV6Mother = constant { [4 x ptr] } {
// OGCG-SAME: [4 x ptr] [
// OGCG-SAME: ptr null,
// OGCG-SAME: ptr null,
@@ -128,7 +128,7 @@ void Child::MotherKey() {}
// LLVM-SAME: ]
// LLVM-SAME: }
-// OGCG: @_ZTV6Father = unnamed_addr constant { [3 x ptr] } {
+// OGCG: @_ZTV6Father = constant { [3 x ptr] } {
// OGCG-SAME: [3 x ptr] [
// OGCG-SAME: ptr null,
// OGCG-SAME: ptr null,
diff --git a/clang/test/CIR/CodeGen/thunks.cpp b/clang/test/CIR/CodeGen/thunks.cpp
index 0fd487491ad14..20b25b1599aac 100644
--- a/clang/test/CIR/CodeGen/thunks.cpp
+++ b/clang/test/CIR/CodeGen/thunks.cpp
@@ -354,27 +354,27 @@ void C::f(int x, ...) {}
// --- OGCG checks ---
-// OGCG: @_ZTVN5Test11CE = unnamed_addr constant { [3 x ptr], [3 x ptr] } {
+// OGCG: @_ZTVN5Test11CE = constant { [3 x ptr], [3 x ptr] } {
// OGCG-SAME: [3 x ptr] [ptr null, ptr null, ptr @_ZN5Test11C1fEv],
// OGCG-SAME: [3 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr null, ptr @_ZThn8_N5Test11C1fEv]
// OGCG-SAME: }
-// OGCG: @_ZTVN5Test21CE = unnamed_addr constant { [3 x ptr], [3 x ptr] } {
+// OGCG: @_ZTVN5Test21CE = constant { [3 x ptr], [3 x ptr] } {
// OGCG-SAME: [3 x ptr] [ptr null, ptr null, ptr @_ZN5Test21C1gEv],
// OGCG-SAME: [3 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr null, ptr @_ZThn8_N5Test21C1gEv]
// OGCG-SAME: }
-// OGCG: @_ZTVN5Test31DE = unnamed_addr constant { [4 x ptr], [4 x ptr] } {
+// OGCG: @_ZTVN5Test31DE = constant { [4 x ptr], [4 x ptr] } {
// OGCG-SAME: [4 x ptr] [ptr null, ptr null, ptr @_ZN5Test31DD1Ev, ptr @_ZN5Test31DD0Ev],
// OGCG-SAME: [4 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr null, ptr @_ZThn8_N5Test31DD1Ev, ptr @_ZThn8_N5Test31DD0Ev]
// OGCG-SAME: }
-// OGCG: @_ZTVN5Test41CE = unnamed_addr constant { [4 x ptr], [3 x ptr] } {
+// OGCG: @_ZTVN5Test41CE = constant { [4 x ptr], [3 x ptr] } {
// OGCG-SAME: [4 x ptr] [ptr null, ptr null, ptr @_ZN5Test41A1fEv, ptr @_ZN5Test41C1gEi],
// OGCG-SAME: [3 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr null, ptr @_ZThn8_N5Test41C1gEi]
// OGCG-SAME: }
-// OGCG: @_ZTVN5Test51CE = unnamed_addr constant { [3 x ptr], [3 x ptr] } {
+// OGCG: @_ZTVN5Test51CE = constant { [3 x ptr], [3 x ptr] } {
// OGCG-SAME: [3 x ptr] [ptr null, ptr null, ptr @_ZN5Test51C1hEv],
// OGCG-SAME: [3 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr null, ptr @_ZThn8_N5Test51C1hEv]
// OGCG-SAME: }
diff --git a/clang/test/CIR/CodeGen/vbase.cpp b/clang/test/CIR/CodeGen/vbase.cpp
index 6a6e1eeb2fdb0..17e99f5b5d683 100644
--- a/clang/test/CIR/CodeGen/vbase.cpp
+++ b/clang/test/CIR/CodeGen/vbase.cpp
@@ -54,7 +54,7 @@ void ppp() { B b; }
// CIR: cir.global "private" {{.*}}@_ZTV1B = #cir.vtable<{#cir.const_array<[#cir.ptr<12 : i64> : !cir.ptr<!u8i>, #cir.ptr<null> : !cir.ptr<!u8i>, #cir.global_view<@_ZTI1B> : !cir.ptr<!u8i>]> : !cir.array<!cir.ptr<!u8i> x 3>}> : !rec_anon_struct3 {alignment = 8 : i64}
// LLVM: @_ZTV1B = linkonce_odr global { [3 x ptr] } { [3 x ptr] [ptr inttoptr (i64 12 to ptr), ptr null, ptr @_ZTI1B] }, comdat, align 8
-// OGCG: @_ZTV1B = linkonce_odr unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr inttoptr (i64 12 to ptr), ptr null, ptr @_ZTI1B] }, comdat, align 8
+// OGCG: @_ZTV1B = linkonce_odr constant { [3 x ptr] } { [3 x ptr] [ptr inttoptr (i64 12 to ptr), ptr null, ptr @_ZTI1B] }, comdat, align 8
// CIR: cir.func {{.*}}@_Z1fv()
// CIR: %[[D:.+]] = cir.alloca !rec_Derived, !cir.ptr<!rec_Derived>, ["d", init]
diff --git a/clang/test/CIR/CodeGen/virtual-function-calls.cpp b/clang/test/CIR/CodeGen/virtual-function-calls.cpp
index d683bd45d7f61..7a7c0a2ebcbe2 100644
--- a/clang/test/CIR/CodeGen/virtual-function-calls.cpp
+++ b/clang/test/CIR/CodeGen/virtual-function-calls.cpp
@@ -20,7 +20,7 @@ A::A() {}
// LLVM: @_ZTV1A = external global { [3 x ptr] }
-// OGCG: @_ZTV1A = external unnamed_addr constant { [3 x ptr] }
+// OGCG: @_ZTV1A = external constant { [3 x ptr] }
// CIR: cir.func{{.*}} @_ZN1AC2Ev(%arg0: !cir.ptr<!rec_A> {{.*}})
// CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr<!rec_A>, !cir.ptr<!cir.ptr<!rec_A>>, ["this", init]
@@ -117,4 +117,4 @@ void call_virtual_fn_in_cleanup_scope() {
// OGCG: call void @_ZN1BC2Ev(ptr {{.*}} %[[B]])
// OGCG: call void @_ZN1B1fEc(ptr {{.*}} %[[B]], i8 noundef signext 99)
// OGCG: call void @_ZN1BD1Ev(ptr {{.*}} %[[B]])
-
\ No newline at end of file
+
diff --git a/clang/test/CIR/CodeGen/vtable-emission.cpp b/clang/test/CIR/CodeGen/vtable-emission.cpp
index ceefb2ab31443..b48757a6d5a8b 100644
--- a/clang/test/CIR/CodeGen/vtable-emission.cpp
+++ b/clang/test/CIR/CodeGen/vtable-emission.cpp
@@ -29,7 +29,7 @@ void S::key() {}
// LLVM: @_ZTV1S = global { [4 x ptr] } { [4 x ptr]
// LLVM-SAME: [ptr null, ptr null, ptr @_ZN1S3keyEv, ptr @_ZN1S6nonKeyEv] }
-// OGCG: @_ZTV1S = unnamed_addr constant { [4 x ptr] } { [4 x ptr]
+// OGCG: @_ZTV1S = constant { [4 x ptr] } { [4 x ptr]
// OGCG-SAME: [ptr null, ptr null, ptr @_ZN1S3keyEv, ptr @_ZN1S6nonKeyEv] }
// CHECK: cir.func {{.*}} @_ZN1S3keyEv
diff --git a/clang/test/CIR/CodeGen/vtable-linkage-explicit-instantiation.cpp b/clang/test/CIR/CodeGen/vtable-linkage-explicit-instantiation.cpp
index 6d68741a89b52..cbb0fa4c571e7 100644
--- a/clang/test/CIR/CodeGen/vtable-linkage-explicit-instantiation.cpp
+++ b/clang/test/CIR/CodeGen/vtable-linkage-explicit-instantiation.cpp
@@ -57,6 +57,6 @@ void use_key() {
// LLVM: @_ZTV7KeyBaseIiE = external global
// LLVM: define {{.*}} @_Z3useP4BaseIiE
-// OGCG: @_ZTV4BaseIiE = external unnamed_addr constant
-// OGCG: @_ZTV7KeyBaseIiE = external unnamed_addr constant
+// OGCG: @_ZTV4BaseIiE = external constant
+// OGCG: @_ZTV7KeyBaseIiE = external constant
// OGCG: define {{.*}} @_Z3useP4BaseIiE
diff --git a/clang/test/CIR/CodeGen/vtt.cpp b/clang/test/CIR/CodeGen/vtt.cpp
index bd926c46d7a9b..c479a3af04853 100644
--- a/clang/test/CIR/CodeGen/vtt.cpp
+++ b/clang/test/CIR/CodeGen/vtt.cpp
@@ -94,7 +94,7 @@ void D::y() {}
// LLVM-RTTI-SAME: [4 x ptr] [ptr null, ptr inttoptr (i64 -40 to ptr), ptr @_ZTI1D, ptr @_ZN1A1vEv]
// LLVM-COMMON-SAME: }, align 8
-// OGCG-COMMON: @_ZTV1D = unnamed_addr constant { [5 x ptr], [4 x ptr], [4 x ptr] } {
+// OGCG-COMMON: @_ZTV1D = constant { [5 x ptr], [4 x ptr], [4 x ptr] } {
// OGCG-NO-RTTI-SAME: [5 x ptr] [ptr inttoptr (i64 40 to ptr), ptr null, ptr null, ptr @_ZN1B1wEv, ptr @_ZN1D1yEv],
// OGCG-RTTI-SAME: [5 x ptr] [ptr inttoptr (i64 40 to ptr), ptr null, ptr @_ZTI1D, ptr @_ZN1B1wEv, ptr @_ZN1D1yEv],
// OGCG-NO-RTTI-SAME: [4 x ptr] [ptr inttoptr (i64 24 to ptr), ptr inttoptr (i64 -16 to ptr), ptr null, ptr @_ZN1C1xEv],
@@ -161,7 +161,7 @@ void D::y() {}
// LLVM-RTTI-SAME: [4 x ptr] [ptr null, ptr inttoptr (i64 -40 to ptr), ptr @_ZTI1B, ptr @_ZN1A1vEv]
// LLVM-COMMON-SAME: }, align 8
-// OGCG-COMMON: @_ZTC1D0_1B = unnamed_addr constant { [4 x ptr], [4 x ptr] } {
+// OGCG-COMMON: @_ZTC1D0_1B = constant { [4 x ptr], [4 x ptr] } {
// OGCG-NO-RTTI-SAME: [4 x ptr] [ptr inttoptr (i64 40 to ptr), ptr null, ptr null, ptr @_ZN1B1wEv],
// OGCG-RTTI-SAME: [4 x ptr] [ptr inttoptr (i64 40 to ptr), ptr null, ptr @_ZTI1B, ptr @_ZN1B1wEv],
// OGCG-NO-RTTI-SAME: [4 x ptr] [ptr null, ptr inttoptr (i64 -40 to ptr), ptr null, ptr @_ZN1A1vEv]
@@ -199,7 +199,7 @@ void D::y() {}
// LLVM-RTTI-SAME: [4 x ptr] [ptr null, ptr inttoptr (i64 -24 to ptr), ptr @_ZTI1C, ptr @_ZN1A1vEv]
// LLVM-COMMON-SAME: }, align 8
-// OGCG-COMMON: @_ZTC1D16_1C = unnamed_addr constant { [4 x ptr], [4 x ptr] } {
+// OGCG-COMMON: @_ZTC1D16_1C = constant { [4 x ptr], [4 x ptr] } {
// OGCG-NO-RTTI-SAME: [4 x ptr] [ptr inttoptr (i64 24 to ptr), ptr null, ptr null, ptr @_ZN1C1xEv],
// OGCG-RTTI-SAME: [4 x ptr] [ptr inttoptr (i64 24 to ptr), ptr null, ptr @_ZTI1C, ptr @_ZN1C1xEv],
// OGCG-NO-RTTI-SAME: [4 x ptr] [ptr null, ptr inttoptr (i64 -24 to ptr), ptr null, ptr @_ZN1A1vEv]
@@ -236,7 +236,7 @@ void D::y() {}
// OGCG-RTTI: @_ZTVN10__cxxabiv121__vmi_class_type_infoE = external global [0 x ptr]
// OGCG-RTTI: @_ZTS1D = constant [3 x i8] c"1D\00", align 1
-// OGCG-RTTI: @_ZTV1A = external unnamed_addr constant { [3 x ptr] }, align 8
+// OGCG-RTTI: @_ZTV1A = external constant { [3 x ptr] }, align 8
D::D() {}
diff --git a/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp b/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp
index 89d719315494e..201dd398bf745 100644
--- a/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp
+++ b/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp
@@ -128,7 +128,7 @@ void use_F() {
// CIR-DAG: cir.global "private" external @_ZTV1D = #cir.vtable<{#cir.const_array<[#cir.ptr<null> : !cir.ptr<!u8i>, #cir.global_view<@_ZTI1D> : !cir.ptr<!u8i>, #cir.global_view<@_ZN1D1fEv> : !cir.ptr<!u8i>]> : !cir.array<!cir.ptr<!u8i> x 3>}> : !{{.*}}{alignment = 8 : i64}
// CIR-DAG: cir.global external @_ZTS1D = #cir.const_array<"1D" : !cir.array<!s8i x 2>, trailing_zeros> : !cir.array<!s8i x 3> {alignment = 1 : i64}
// CIR-DAG: cir.global constant external @_ZTI1D = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr<!u8i>, #cir.global_view<@_ZTS1D> : !cir.ptr<!u8i>}> : !{{.*}}{alignment = 8 : i64}
-// LLVM-DAG: @_ZTV1D = {{(unnamed_addr constant|global)}} { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI1D, ptr @_ZN1D1fEv] }, align 8
+// LLVM-DAG: @_ZTV1D = {{(constant|global)}} { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI1D, ptr @_ZN1D1fEv] }, align 8
// LLVM-DAG: @_ZTS1D = {{(constant|global)}} [{{[0-9]}} x i8] c"1D\00", align 1
// LLVM-DAG: @_ZTI1D = constant { ptr, ptr } { ptr getelementptr {{.*}}({{.*}}, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 {{[0-9]+}}), ptr @_ZTS1D }, align 8
@@ -138,7 +138,7 @@ void use_F() {
// CIR-DAG: cir.global "private" external @_ZTV1EIcE = #cir.vtable<{#cir.const_array<[#cir.ptr<null> : !cir.ptr<!u8i>, #cir.global_view<@_ZTI1EIcE> : !cir.ptr<!u8i>, #cir.global_view<@_ZN1EIcE6anchorEv> : !cir.ptr<!u8i>]> : !cir.array<!cir.ptr<!u8i> x 3>}> : !{{.*}}{alignment = 8 : i64}
// CIR-DAG: cir.global external @_ZTS1EIcE = #cir.const_array<"1EIcE" : !cir.array<!s8i x 5>, trailing_zeros> : !cir.array<!s8i x 6> {alignment = 1 : i64}
// CIR-DAG: cir.global constant external @_ZTI1EIcE = #cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : i32]> : !cir.ptr<!u8i>, #cir.global_view<@_ZTS1EIcE> : !cir.ptr<!u8i>}> : !{{.*}}{alignment = 8 : i64}
-// LLVM-DAG: @_ZTV1EIcE = {{(unnamed_addr constant|global)}} { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI1EIcE, ptr @_ZN1EIcE6anchorEv] }, align 8
+// LLVM-DAG: @_ZTV1EIcE = {{(constant|global)}} { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI1EIcE, ptr @_ZN1EIcE6anchorEv] }, align 8
// LLVM-DAG: @_ZTS1EIcE = {{(constant|global)}} [6 x i8] c"1EIcE\00", align 1
// LLVM-DAG: @_ZTI1EIcE = constant { ptr, ptr } { ptr getelementptr {{.*}}({{.*}}, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 {{.*}}), ptr @_ZTS1EIcE }, align 8
More information about the cfe-commits
mailing list