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.
21 lines
543 B
LLVM
21 lines
543 B
LLVM
; An arc holds only ArcSafe values: a mutex is Share but not ArcSafe (E2111).
|
|
; expect: reject E2111
|
|
; phase: 4
|
|
; spec: docs/spec/03-memory-model.md
|
|
module test.arc_content_mutex
|
|
air 0
|
|
lang 0.1
|
|
features [arc, cancellation, capabilities, effects, heap, islands, ownership, resources, sync, tasks]
|
|
|
|
fn @main(%heap: cap<mem.alloc>) -> u64
|
|
effects [mem.alloc]
|
|
entry:
|
|
%v = const.u64 1
|
|
%m = mutex.make %v
|
|
arc.new %m, %heap, ok -> @made, err -> @oom
|
|
made(%a: arc<mutex<u64>>):
|
|
arc.release %a
|
|
ret %v
|
|
oom(%e: alloc_error):
|
|
trap
|