Skip to content

Commit 142c1e3

Browse files
gbaraldiKristofferC
authored andcommitted
Fix removal of globals with addrspaces in removeAddrspaces (#58322)
(cherry picked from commit 088bb90)
1 parent 9aab1f9 commit 142c1e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/llvmpasses/remove-addrspaces.ll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
; RUN: opt -enable-new-pm=0 --opaque-pointers=1 -load libjulia-codegen%shlibext -RemoveJuliaAddrspaces -S %s | FileCheck %s --check-prefixes=CHECK,OPAQUE
77
; RUN: opt -enable-new-pm=1 --opaque-pointers=1 --load-pass-plugin=libjulia-codegen%shlibext -passes='RemoveJuliaAddrspaces' -S %s | FileCheck %s --check-prefixes=CHECK,OPAQUE
88

9+
; COM: check that the addrspace of the global itself is removed
10+
; OPAQUE: @ejl_enz_runtime_exc = external global {}
11+
@ejl_enz_runtime_exc = external addrspace(10) global {}
912

1013
; COM: check that package image fptrs work
1114
@pjlsys_BoundsError_32 = internal global {} addrspace(10)* ({}***, {} addrspace(10)*, [1 x i64] addrspace(11)*)* null
@@ -134,6 +137,13 @@ L6:
134137
unreachable
135138
}
136139

140+
define private fastcc void @diffejulia__mapreduce_97() {
141+
L6:
142+
; OPAQUE: store atomic ptr @ejl_enz_runtime_exc, ptr null unordered
143+
store atomic {} addrspace(10)* @ejl_enz_runtime_exc, {} addrspace(10)* addrspace(10)* null unordered, align 8
144+
unreachable
145+
}
146+
137147
; COM: check that function attributes are preserved on declarations too
138148
declare void @convergent_function() #0
139149
attributes #0 = { convergent }

0 commit comments

Comments
 (0)