[llvm] c353d8f - LowerGlobalDestructors: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 06:08:47 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T09:08:31-05:00
New Revision: c353d8f49b2b348ba8d233b82361f6188178ddda
URL: https://github.com/llvm/llvm-project/commit/c353d8f49b2b348ba8d233b82361f6188178ddda
DIFF: https://github.com/llvm/llvm-project/commit/c353d8f49b2b348ba8d233b82361f6188178ddda.diff
LOG: LowerGlobalDestructors: Convert tests to opaque pointers
Added:
Modified:
llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors-existing-dos_handle.ll
llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors-existing-dos_handle.ll b/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors-existing-dos_handle.ll
index cf59995785549..7b3c557cb0fd1 100644
--- a/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors-existing-dos_handle.ll
+++ b/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors-existing-dos_handle.ll
@@ -8,8 +8,8 @@
declare void @foo()
- at llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 0, void ()* @foo, i8* null }
+ at llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 0, ptr @foo, ptr null }
]
-; CHECK: call i32 @__cxa_atexit(void (i8*)* @call_dtors.0, i8* null, i8* bitcast (%struct.mach_header* @__dso_handle to i8*))
+; CHECK: call i32 @__cxa_atexit(ptr @call_dtors.0, ptr null, ptr @__dso_handle)
diff --git a/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors.ll b/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors.ll
index 7d4524fcf0970..63cc73c6ed9e3 100644
--- a/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors.ll
+++ b/llvm/test/Transforms/LowerGlobalDestructors/lower-global-dtors.ll
@@ -24,25 +24,25 @@ declare void @after_the_null()
@associatedc2 = global i8 42
@associatedc3 = global i8 84
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 200, void ()* @orig_ctor, i8* null }
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 200, ptr @orig_ctor, ptr null }
]
- at llvm.global_dtors = appending global [14 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 0, void ()* @orig_dtor0, i8* null },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1a, i8* null },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1b, i8* null },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c0, i8* @associatedc0 },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c1a, i8* @associatedc1 },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c1b, i8* @associatedc1 },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c2a, i8* @associatedc2 },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c2b, i8* @associatedc2 },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c3, i8* @associatedc3 },
- { i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1d, i8* null },
- { i32, void ()*, i8* } { i32 65535, void ()* @orig_dtor65535c0, i8* @associatedc0 },
- { i32, void ()*, i8* } { i32 65535, void ()* @orig_dtor65535, i8* null },
- { i32, void ()*, i8* } { i32 65535, void ()* null, i8* null },
- { i32, void ()*, i8* } { i32 65535, void ()* @after_the_null, i8* null }
+ at llvm.global_dtors = appending global [14 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 0, ptr @orig_dtor0, ptr null },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1a, ptr null },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1b, ptr null },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1c0, ptr @associatedc0 },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1c1a, ptr @associatedc1 },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1c1b, ptr @associatedc1 },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1c2a, ptr @associatedc2 },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1c2b, ptr @associatedc2 },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1c3, ptr @associatedc3 },
+ { i32, ptr, ptr } { i32 1, ptr @orig_dtor1d, ptr null },
+ { i32, ptr, ptr } { i32 65535, ptr @orig_dtor65535c0, ptr @associatedc0 },
+ { i32, ptr, ptr } { i32 65535, ptr @orig_dtor65535, ptr null },
+ { i32, ptr, ptr } { i32 65535, ptr null, ptr null },
+ { i32, ptr, ptr } { i32 65535, ptr @after_the_null, ptr null }
]
; CHECK: @associatedc0 = external global i8
@@ -51,31 +51,31 @@ declare void @after_the_null()
; CHECK: @associatedc3 = global i8 84
; CHECK: @__dso_handle = extern_weak hidden constant i8
-; CHECK-LABEL: @llvm.global_ctors = appending global [10 x { i32, void ()*, i8* }] [
-; CHECK-SAME: { i32, void ()*, i8* } { i32 200, void ()* @orig_ctor, i8* null },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @register_call_dtors.0, i8* null },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 1, void ()* @"register_call_dtors.1$0", i8* null },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 1, void ()* @"register_call_dtors.1$1.associatedc0", i8* @associatedc0 },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 1, void ()* @"register_call_dtors.1$2.associatedc1", i8* @associatedc1 },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 1, void ()* @"register_call_dtors.1$3.associatedc2", i8* @associatedc2 },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 1, void ()* @"register_call_dtors.1$4.associatedc3", i8* @associatedc3 },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 1, void ()* @"register_call_dtors.1$5", i8* null },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* @"register_call_dtors$0.associatedc0", i8* @associatedc0 },
-; CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* @"register_call_dtors$1", i8* null }]
+; CHECK-LABEL: @llvm.global_ctors = appending global [10 x { i32, ptr, ptr }] [
+; CHECK-SAME: { i32, ptr, ptr } { i32 200, ptr @orig_ctor, ptr null },
+; CHECK-SAME: { i32, ptr, ptr } { i32 0, ptr @register_call_dtors.0, ptr null },
+; CHECK-SAME: { i32, ptr, ptr } { i32 1, ptr @"register_call_dtors.1$0", ptr null },
+; CHECK-SAME: { i32, ptr, ptr } { i32 1, ptr @"register_call_dtors.1$1.associatedc0", ptr @associatedc0 },
+; CHECK-SAME: { i32, ptr, ptr } { i32 1, ptr @"register_call_dtors.1$2.associatedc1", ptr @associatedc1 },
+; CHECK-SAME: { i32, ptr, ptr } { i32 1, ptr @"register_call_dtors.1$3.associatedc2", ptr @associatedc2 },
+; CHECK-SAME: { i32, ptr, ptr } { i32 1, ptr @"register_call_dtors.1$4.associatedc3", ptr @associatedc3 },
+; CHECK-SAME: { i32, ptr, ptr } { i32 1, ptr @"register_call_dtors.1$5", ptr null },
+; CHECK-SAME: { i32, ptr, ptr } { i32 65535, ptr @"register_call_dtors$0.associatedc0", ptr @associatedc0 },
+; CHECK-SAME: { i32, ptr, ptr } { i32 65535, ptr @"register_call_dtors$1", ptr null }]
; CHECK: declare void @orig_ctor()
; CHECK: declare void @orig_dtor0()
; --- other dtors here ---
; CHECK: declare void @after_the_null()
-; CHECK: declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
+; CHECK: declare i32 @__cxa_atexit(ptr, ptr, ptr)
-; CHECK-LABEL: define private void @call_dtors.0(i8* %0)
+; CHECK-LABEL: define private void @call_dtors.0(ptr %0)
; CHECK: call void @orig_dtor0()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @register_call_dtors.0()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @call_dtors.0, i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @call_dtors.0, ptr null, ptr @__dso_handle)
; CHECK-NEXT: %0 = icmp ne i32 %call, 0
; CHECK-NEXT: br i1 %0, label %fail, label %return
; CHECK-EMPTY:
@@ -86,64 +86,64 @@ declare void @after_the_null()
; CHECK-NEXT: return:
; CHECK-NEXT: ret void
-; CHECK-LABEL: define private void @"call_dtors.1$0"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors.1$0"(ptr %0)
; CHECK: call void @orig_dtor1b()
; CHECK-NEXT: call void @orig_dtor1a()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors.1$0"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors.1$0", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors.1$0", ptr null, ptr @__dso_handle)
-; CHECK-LABEL: define private void @"call_dtors.1$1.associatedc0"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors.1$1.associatedc0"(ptr %0)
; CHECK: call void @orig_dtor1c0()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors.1$1.associatedc0"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors.1$1.associatedc0", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors.1$1.associatedc0", ptr null, ptr @__dso_handle)
-; CHECK-LABEL: define private void @"call_dtors.1$2.associatedc1"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors.1$2.associatedc1"(ptr %0)
; CHECK: call void @orig_dtor1c1b()
; CHECK-NEXT: call void @orig_dtor1c1a()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors.1$2.associatedc1"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors.1$2.associatedc1", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors.1$2.associatedc1", ptr null, ptr @__dso_handle)
-; CHECK-LABEL: define private void @"call_dtors.1$3.associatedc2"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors.1$3.associatedc2"(ptr %0)
; CHECK: call void @orig_dtor1c2b()
; CHECK-NEXT: call void @orig_dtor1c2a()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors.1$3.associatedc2"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors.1$3.associatedc2", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors.1$3.associatedc2", ptr null, ptr @__dso_handle)
-; CHECK-LABEL: define private void @"call_dtors.1$4.associatedc3"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors.1$4.associatedc3"(ptr %0)
; CHECK: call void @orig_dtor1c3()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors.1$4.associatedc3"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors.1$4.associatedc3", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors.1$4.associatedc3", ptr null, ptr @__dso_handle)
-; CHECK-LABEL: define private void @"call_dtors.1$5"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors.1$5"(ptr %0)
; CHECK: call void @orig_dtor1d()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors.1$5"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors.1$5", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors.1$5", ptr null, ptr @__dso_handle)
-; CHECK-LABEL: define private void @"call_dtors$0.associatedc0"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors$0.associatedc0"(ptr %0)
; CHECK: call void @orig_dtor65535c0()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors$0.associatedc0"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors$0.associatedc0", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors$0.associatedc0", ptr null, ptr @__dso_handle)
-; CHECK-LABEL: define private void @"call_dtors$1"(i8* %0)
+; CHECK-LABEL: define private void @"call_dtors$1"(ptr %0)
; CHECK: call void @orig_dtor65535()
; CHECK-NEXT: ret void
; CHECK-LABEL: define private void @"register_call_dtors$1"()
-; CHECK: %call = call i32 @__cxa_atexit(void (i8*)* @"call_dtors$1", i8* null, i8* @__dso_handle)
+; CHECK: %call = call i32 @__cxa_atexit(ptr @"call_dtors$1", ptr null, ptr @__dso_handle)
; This function is listed after the null terminator, so it should
More information about the llvm-commits
mailing list