-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
115 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[deps] | ||
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | ||
LLVMExtra_jll = "dad2f222-ce93-54a1-a47d-0025e8a3acab" | ||
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@testset "bitcode" begin | ||
@testitem "bitcode" begin | ||
|
||
@dispose ctx=Context() begin | ||
invalid_bitcode = "invalid" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@testset "buffer" begin | ||
@testitem "buffer" begin | ||
|
||
data = rand(UInt8, 8) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@testset "datalayout" begin | ||
@testitem "datalayout" begin | ||
|
||
dlstr = "E-p:32:32-f128:128:128" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using LLVM,Test | ||
|
||
@testset "debuginfo" begin | ||
@testitem "debuginfo" begin | ||
|
||
DEBUG_METADATA_VERSION() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@testitem "essentials" begin | ||
|
||
@testset "types" begin | ||
@test convert(Bool, LLVM.True) == true | ||
@test convert(Bool, LLVM.False) == false | ||
|
||
@test_throws ArgumentError LLVM.convert(Bool, LLVM.API.LLVMBool(2)) | ||
|
||
@test convert(LLVM.Bool, true) == LLVM.True | ||
@test convert(LLVM.Bool, false) == LLVM.False | ||
end | ||
|
||
@testset "pass registry" begin | ||
passreg = GlobalPassRegistry() | ||
|
||
@test version() isa VersionNumber | ||
@test ismultithreaded() isa Bool | ||
|
||
InitializeCore(passreg) | ||
InitializeTransformUtils(passreg) | ||
InitializeScalarOpts(passreg) | ||
InitializeObjCARCOpts(passreg) | ||
InitializeVectorization(passreg) | ||
InitializeInstCombine(passreg) | ||
InitializeIPO(passreg) | ||
InitializeInstrumentation(passreg) | ||
InitializeAnalysis(passreg) | ||
InitializeIPA(passreg) | ||
InitializeCodeGen(passreg) | ||
InitializeTarget(passreg) | ||
|
||
InitializeNativeTarget() | ||
InitializeAllTargetInfos() | ||
InitializeAllTargetMCs() | ||
InitializeNativeAsmPrinter() | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@testset "execution" begin | ||
@testitem "execution" begin | ||
|
||
@testset "generic values" begin | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
@testsetup module TestHelpers | ||
|
||
using Test | ||
|
||
export @check_ir | ||
|
||
macro check_ir(inst, str) | ||
quote | ||
inst = string($(esc(inst))) | ||
@test occursin($(str), inst) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@testset "ir" begin | ||
@testitem "ir" begin | ||
|
||
@dispose ctx=Context() begin | ||
invalid_ir = "invalid" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@testset "linker" begin | ||
@testitem "linker" begin | ||
|
||
@dispose ctx=Context() builder=IRBuilder() begin | ||
mod1 = let | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
@testset "moduleprovider" begin | ||
@testitem "moduleprovider" begin | ||
|
||
@dispose ctx=Context() begin | ||
mod = LLVM.Module("SomeModule") | ||
mp = ModuleProvider(mod) | ||
dispose(mp) | ||
|
||
@test "we didn't crash!" != "" | ||
end | ||
|
||
@dispose ctx=Context() begin | ||
mod = LLVM.Module("SomeModule") | ||
ModuleProvider(mod) do md | ||
end | ||
|
||
@test "we didn't crash!" != "" | ||
end | ||
|
||
@dispose ctx=Context() begin | ||
mod = LLVM.Module("SomeModule") | ||
@dispose mp=ModuleProvider(mod) begin | ||
|
||
end | ||
|
||
@test "we didn't crash!" != "" | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@testset "passmanager" begin | ||
@testitem "passmanager" begin | ||
|
||
let | ||
mpm = ModulePassManager() | ||
|
Oops, something went wrong.