Skip to content

Commit be95dcd

Browse files
authored
Fix supports_typed_pointers pre LLVM 14 (#330)
1 parent 00e61c8 commit be95dcd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/core/context.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ GlobalContext() = Context(API.LLVMGetGlobalContext())
3030
if version() > v"13.0.0"
3131
supports_typed_pointers(ctx::Context) = API.LLVMContextSupportsTypedPointers(ctx) == 1
3232
else
33-
supports_typed_pointers(ctx::Context) = false
33+
supports_typed_pointers(ctx::Context) = true
3434
end
3535

3636
## wrapper exception type

test/core.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Context() do ctx end
2727

2828
@dispose ctx=Context() begin
2929
@test LLVM.supports_typed_pointers(ctx) isa Bool
30+
if LLVM.version() > v"15.0.0"
31+
@test LLVM.supports_typed_pointers(ctx) == false
32+
elseif LLVM.version() > v"14.0.0"
33+
@test LLVM.supports_typed_pointers(ctx) isa Bool
34+
else
35+
@test LLVM.supports_typed_pointers(ctx) == true
36+
end
3037
end
3138

3239
end

0 commit comments

Comments
 (0)