Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/newpm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ end

@testset "passes" begin
function test_passes(typ, passes, skips=String[])
@dispose ctx=Context() mod=test_module() begin
@dispose ctx=Context() begin
for pass in passes
if startswith(pass, "print") || startswith(pass, "dot") ||
startswith(pass, "view") || pass in skips
Expand All @@ -139,14 +139,16 @@ end

# the first pass determines the pass manager's type, so add the pass and
# then a no-op one that would trigger an error in case of type mismatches.
@dispose pb=NewPMPassBuilder() begin
# use a fresh module per run so instrumentation passes (tsan/asan/hwasan)
# don't trip their redundant-instrumentation check on the second invocation.
@dispose pb=NewPMPassBuilder() mod=test_module() begin
add!(pb, pass)
add!(pb, "no-op-$typ")
@test run!(pb, mod) === nothing
end

# same, but to catch type mismatches in the other direction
@dispose pb=NewPMPassBuilder() begin
@dispose pb=NewPMPassBuilder() mod=test_module() begin
add!(pb, "no-op-$typ")
add!(pb, pass)
@test run!(pb, mod) === nothing
Expand Down
Loading