24 lines
487 B
LLVM
24 lines
487 B
LLVM
; expect: run
|
|
; result: 2
|
|
; phase: 1
|
|
; spec: docs/spec/10-diagnostics-and-agent-protocol.md §2
|
|
module related.valid
|
|
air 0
|
|
lang 0.1
|
|
features [ownership]
|
|
fn @main() -> u64
|
|
effects []
|
|
entry:
|
|
%data = local.alloc u64
|
|
%one = const.u64 1
|
|
local.store %data, %one
|
|
%view = borrow.ref %data
|
|
%read = load %view
|
|
%same = eq.u64 %read, %one
|
|
assert %same
|
|
borrow.end %view
|
|
%two = const.u64 2
|
|
local.store %data, %two
|
|
%result = local.load %data
|
|
ret %result
|