New AIR rejects: island_use_after_send (E2001), island_lend_task (E4002), island_destroy_while_borrowed (E2101), arc_content_mutex (E2111), frozen_borrow_mut (E1001). Every Phase 4 invariant now has an AIR and an .aji test. Full suite 392/392, also under --stress 1000 and --collect-every-step; test-extended, hosted smoke, source coverage 61/61.
27 lines
683 B
LLVM
27 lines
683 B
LLVM
; A frozen graph never yields a mutable reference: frozen.borrow gives ref<T>, and a store through it is E1001.
|
|
; expect: reject E1001
|
|
; phase: 4
|
|
; spec: docs/spec/03-memory-model.md
|
|
module test.frozen_borrow_mut
|
|
air 0
|
|
lang 0.1
|
|
features [capabilities, effects, heap, islands, ownership, resources]
|
|
|
|
fn @main(%heap: cap<mem.alloc>) -> u64
|
|
effects [mem.alloc]
|
|
entry:
|
|
%v = const.u64 1
|
|
island.create %v, %heap, ok -> @made, err -> @oom
|
|
made(%i: island<u64>):
|
|
%f = island.freeze %i
|
|
%g = borrow.ref %f
|
|
%r = frozen.root %g
|
|
%p = frozen.borrow %g, %r
|
|
store %p, %v
|
|
borrow.end %p
|
|
borrow.end %g
|
|
frozen.release %f
|
|
ret %v
|
|
oom(%e: alloc_error):
|
|
trap
|