[llvm] [IR] Allow uses of `llvm.global_ctors` and `llvm.global_dtors` (PR #96477)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 02:19:54 PDT 2024


================
@@ -16,7 +16,7 @@ define void @existing_ctor() addrspace(1) {
 ; CHECK-FINAL: [[TABLE:@[0-9]+]] = internal addrspace(2) global [6 x ptr addrspace(1)] poison, align 8
 
 ; CHECK-FINAL: @llvm.global_ctors = appending addrspace(2) global [2 x { i32, ptr addrspace(1), ptr }] [{ i32, ptr addrspace(1), ptr } { i32 0, ptr addrspace(1) @existing_ctor, ptr null }, { i32, ptr addrspace(1), ptr } { i32 10, ptr addrspace(1) [[TABLE_CTOR:@[0-9]+]], ptr null }]
- at llvm.global_ctors = appending global [1 x { i32, ptr addrspace(1), ptr }] [{ i32, ptr addrspace(1), ptr } { i32 0, ptr addrspace(1) @existing_ctor, ptr null }]
+ at llvm.global_ctors = appending addrspace(2) global [1 x { i32, ptr addrspace(1), ptr }] [{ i32, ptr addrspace(1), ptr } { i32 0, ptr addrspace(1) @existing_ctor, ptr null }]
----------------
arsenm wrote:

You can't just adjust the test to avoid an assert, you have to fix the assert 

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


More information about the llvm-commits mailing list