Skip to content

Commit 123a650

Browse files
author
oscarddssmith
committed
add test
1 parent adfe9be commit 123a650

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/codegen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ static const auto jl_alloc_genericmemory_unchecked_func = new JuliaFunction<Type
11791179
},
11801180
[](LLVMContext &C) {
11811181
auto FnAttrs = AttrBuilder(C);
1182+
FnAttrs.addAllocKindAttr(AllocFnKind::Alloc);
11821183
FnAttrs.addMemoryAttr(MemoryEffects::argMemOnly(ModRefInfo::Ref) | MemoryEffects::inaccessibleMemOnly(ModRefInfo::ModRef));
11831184
FnAttrs.addAttribute(Attribute::WillReturn);
11841185
FnAttrs.addAttribute(Attribute::NoUnwind);

test/boundscheck_exec.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,13 @@ if bc_opt == bc_default
337337
end
338338
@test confuse_alias_analysis() == 3
339339
@test (@allocated confuse_alias_analysis()) == 0
340+
function no_alias_prove(n)
341+
m1 = Memory{Int}(undef,n)
342+
m2 = Memory{Int}(undef,n)
343+
m1 === m2
344+
end
345+
no_alias_prove(1)
346+
@test (@allocated no_alias_prove(5)) == 0
340347
end
341348
end
342349

0 commit comments

Comments
 (0)