32 lines
686 B
LLVM
32 lines
686 B
LLVM
; The scope and its task are passed together through block arguments; the renamed scope ends while the renamed task is unjoined.
|
|
; expect: reject E4301
|
|
; phase: 3
|
|
; spec: docs/spec/04-concurrency-and-atomics.md §33
|
|
module test.cfg_provenance_scope_task
|
|
air 0
|
|
lang 0.1
|
|
features [cancellation, effects, ownership, tasks]
|
|
|
|
fn @main() -> u8
|
|
effects [task.spawn, task.wait]
|
|
entry:
|
|
%sc = task.scope.begin
|
|
%t = task.spawn %sc, @zero()
|
|
br @next(%sc, %t)
|
|
next(%s2: scope, %t2: task<u8>):
|
|
task.scope.end %s2
|
|
%v = const.u8 0
|
|
ret %v
|
|
|
|
fn @rd(%p: ref<u8>) -> u8
|
|
effects []
|
|
entry:
|
|
%v = load %p
|
|
ret %v
|
|
|
|
fn @zero() -> u8
|
|
effects []
|
|
entry:
|
|
%z = const.u8 0
|
|
ret %z
|