Skip to content

Commit c18e0ba

Browse files
committed
add test for DynamicLibDefinitionGenerator
1 parent e7f4f96 commit c18e0ba

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
33
LLVMExtra_jll = "dad2f222-ce93-54a1-a47d-0025e8a3acab"
4+
NUMA_jll = "7f51dc2b-bb24-59f8-b771-bb1490e4195d"
45
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
56
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

test/orcv2.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,4 +302,21 @@ end
302302
end
303303
end
304304

305+
import NUMA_jll
306+
307+
@testset "CustomDefinitionGenerator" begin
308+
@dispose lljit=LLJIT() begin
309+
if NUMA_jll.is_available()
310+
@test_throws lookup(lljit, "numa_available")
311+
312+
dg = LLVM.DynamicLibDefinitionGenerator(NUMA_jll.libnuma)
313+
jd = JITDylib(lljit)
314+
LLVM.add!(jd, dg)
315+
316+
addr = lookup(lljit, "numa_available")
317+
@test addr !== C_NULL
318+
end
319+
end
320+
end
321+
305322
end

0 commit comments

Comments
 (0)