Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Jan 2, 2025
1 parent 21b26ed commit 1f95279
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,7 @@ static const auto jl_alloc_genericmemory_unchecked_func = new JuliaFunction<Type
},
[](LLVMContext &C) {
auto FnAttrs = AttrBuilder(C);
FnAttrs.addAllocKindAttr(AllocFnKind::Alloc);
FnAttrs.addMemoryAttr(MemoryEffects::argMemOnly(ModRefInfo::Ref) | MemoryEffects::inaccessibleMemOnly(ModRefInfo::ModRef));
FnAttrs.addAttribute(Attribute::WillReturn);
FnAttrs.addAttribute(Attribute::NoUnwind);
Expand Down
7 changes: 7 additions & 0 deletions test/boundscheck_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@ if bc_opt == bc_default
end
@test confuse_alias_analysis() == 3
@test (@allocated confuse_alias_analysis()) == 0
function no_alias_prove(n)
m1 = Memory{Int}(undef,n)
m2 = Memory{Int}(undef,n)
m1 === m2
end
no_alias_prove(1)
@test (@allocated no_alias_prove(5)) == 0
end
end

Expand Down

0 comments on commit 1f95279

Please sign in to comment.