Skip to content

Commit a3b83ff

Browse files
committed
Fix tests for LLVM < 9.0
1 parent 013a23a commit a3b83ff

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/core.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,18 +700,26 @@ end
700700

701701
Context() do ctx
702702
LLVM.Module("SomeModule", ctx) do mod
703-
intr = Intrinsic("llvm.sin")
703+
intr_ft = LLVM.FunctionType(LLVM.DoubleType(ctx), [LLVM.DoubleType(ctx)])
704+
intr_fn = LLVM.Function(mod, "llvm.sin.f64", intr_ft)
705+
@test isintrinsic(intr_fn)
706+
707+
intr = Intrinsic(intr_fn)
704708
@test isoverloaded(intr)
705709

710+
if LLVM.version() >= v"9"
711+
@test intr == Intrinsic("llvm.sin")
712+
end
713+
706714
@test name(intr) == "llvm.sin"
707715
@test name(intr, [LLVM.DoubleType(ctx)]) == "llvm.sin.f64"
708716

709717
ft = FunctionType(intr, [LLVM.DoubleType(ctx)])
718+
@test ft isa FunctionType
710719
@test return_type(ft) == LLVM.DoubleType(ctx)
711-
@test isempty(functions(mod))
712720

713721
fn = LLVM.Function(mod, intr, [LLVM.DoubleType(ctx)])
714-
@test first(functions(mod)) == fn
722+
@test fn isa LLVM.Function
715723
@test eltype(llvmtype(fn)) == ft
716724
@test isintrinsic(fn)
717725
end

0 commit comments

Comments
 (0)