[clang] 465d908 - [test][clang] Opaquify pragma-init_seg.cpp
Arthur Eubanks via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 15 10:45:40 PDT 2022
Author: Arthur Eubanks
Date: 2022-08-15T10:45:24-07:00
New Revision: 465d9084ece1626335bc41eac96c56428faed7e9
URL: https://github.com/llvm/llvm-project/commit/465d9084ece1626335bc41eac96c56428faed7e9
DIFF: https://github.com/llvm/llvm-project/commit/465d9084ece1626335bc41eac96c56428faed7e9.diff
LOG: [test][clang] Opaquify pragma-init_seg.cpp
Added:
Modified:
clang/test/CodeGenCXX/pragma-init_seg.cpp
Removed:
################################################################################
diff --git a/clang/test/CodeGenCXX/pragma-init_seg.cpp b/clang/test/CodeGenCXX/pragma-init_seg.cpp
index a35b16baf4228..187a06a0c0f0c 100644
--- a/clang/test/CodeGenCXX/pragma-init_seg.cpp
+++ b/clang/test/CodeGenCXX/pragma-init_seg.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers %s -triple=i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple=i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
int f();
@@ -10,12 +10,12 @@ namespace simple_init {
#pragma init_seg(compiler)
int x = f();
// CHECK: @"?x at simple_init@@3HA" = dso_local global i32 0, align 4
-// CHECK: @__cxx_init_fn_ptr = private constant void ()* @"??__Ex at simple_init@@YAXXZ", section ".CRT$XCC"
+// CHECK: @__cxx_init_fn_ptr = private constant ptr @"??__Ex at simple_init@@YAXXZ", section ".CRT$XCC"
#pragma init_seg(lib)
int y = f();
// CHECK: @"?y at simple_init@@3HA" = dso_local global i32 0, align 4
-// CHECK: @__cxx_init_fn_ptr.1 = private constant void ()* @"??__Ey at simple_init@@YAXXZ", section ".CRT$XCL"
+// CHECK: @__cxx_init_fn_ptr.1 = private constant ptr @"??__Ey at simple_init@@YAXXZ", section ".CRT$XCL"
#pragma init_seg(user)
int z = f();
@@ -29,14 +29,14 @@ namespace internal_init {
namespace {
int x = f();
// CHECK: @"?x@?A0x{{[^@]*}}@internal_init@@3HA" = internal global i32 0, align 4
-// CHECK: @__cxx_init_fn_ptr.2 = private constant void ()* @"??__Ex@?A0x{{[^@]*}}@internal_init@@YAXXZ", section ".asdf"
+// CHECK: @__cxx_init_fn_ptr.2 = private constant ptr @"??__Ex@?A0x{{[^@]*}}@internal_init@@YAXXZ", section ".asdf"
}
}
namespace selectany_init {
int __declspec(selectany) x = f();
// CHECK: @"?x at selectany_init@@3HA" = weak_odr dso_local global i32 0, comdat, align 4
-// CHECK: @__cxx_init_fn_ptr.3 = private constant void ()* @"??__Ex at selectany_init@@YAXXZ", section ".asdf", comdat($"?x at selectany_init@@3HA")
+// CHECK: @__cxx_init_fn_ptr.3 = private constant ptr @"??__Ex at selectany_init@@YAXXZ", section ".asdf", comdat($"?x at selectany_init@@3HA")
}
namespace explicit_template_instantiation {
@@ -44,7 +44,7 @@ template <typename T> struct A { static const int x; };
template <typename T> const int A<T>::x = f();
template struct A<int>;
// CHECK: @"?x@?$A at H@explicit_template_instantiation@@2HB" = weak_odr dso_local global i32 0, comdat, align 4
-// CHECK: @__cxx_init_fn_ptr.4 = private constant void ()* @"??__E?x@?$A at H@explicit_template_instantiation@@2HB@@YAXXZ", section ".asdf", comdat($"?x@?$A at H@explicit_template_instantiation@@2HB")
+// CHECK: @__cxx_init_fn_ptr.4 = private constant ptr @"??__E?x@?$A at H@explicit_template_instantiation@@2HB@@YAXXZ", section ".asdf", comdat($"?x@?$A at H@explicit_template_instantiation@@2HB")
}
namespace implicit_template_instantiation {
@@ -52,21 +52,21 @@ template <typename T> struct A { static const int x; };
template <typename T> const int A<T>::x = f();
int g() { return A<int>::x; }
// CHECK: @"?x@?$A at H@implicit_template_instantiation@@2HB" = linkonce_odr dso_local global i32 0, comdat, align 4
-// CHECK: @__cxx_init_fn_ptr.5 = private constant void ()* @"??__E?x@?$A at H@implicit_template_instantiation@@2HB@@YAXXZ", section ".asdf", comdat($"?x@?$A at H@implicit_template_instantiation@@2HB")
+// CHECK: @__cxx_init_fn_ptr.5 = private constant ptr @"??__E?x@?$A at H@implicit_template_instantiation@@2HB@@YAXXZ", section ".asdf", comdat($"?x@?$A at H@implicit_template_instantiation@@2HB")
}
// ... and here's where we emitted user level ctors.
-// CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }]
-// CHECK: [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_pragma_init_seg.cpp, i8* null }]
+// CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }]
+// CHECK: [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_pragma_init_seg.cpp, ptr null }]
// We have to mark everything used so we can survive globalopt, even through
// LTO. There's no way LLVM could really understand if data in the .asdf
// section is really used or dead.
//
-// CHECK: @llvm.used = appending global [6 x i8*]
-// CHECK: [i8* bitcast (void ()** @__cxx_init_fn_ptr to i8*),
-// CHECK: i8* bitcast (void ()** @__cxx_init_fn_ptr.1 to i8*),
-// CHECK: i8* bitcast (void ()** @__cxx_init_fn_ptr.2 to i8*),
-// CHECK: i8* bitcast (void ()** @__cxx_init_fn_ptr.3 to i8*),
-// CHECK: i8* bitcast (void ()** @__cxx_init_fn_ptr.4 to i8*),
-// CHECK: i8* bitcast (void ()** @__cxx_init_fn_ptr.5 to i8*)], section "llvm.metadata"
+// CHECK: @llvm.used = appending global [6 x ptr]
+// CHECK: [ptr @__cxx_init_fn_ptr,
+// CHECK: ptr @__cxx_init_fn_ptr.1,
+// CHECK: ptr @__cxx_init_fn_ptr.2,
+// CHECK: ptr @__cxx_init_fn_ptr.3,
+// CHECK: ptr @__cxx_init_fn_ptr.4,
+// CHECK: ptr @__cxx_init_fn_ptr.5], section "llvm.metadata"
More information about the cfe-commits
mailing list