Skip to content

Commit 7256404

Browse files
committed
Create globals_func_vm.lyte
1 parent b3ca3e9 commit 7256404

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/cases/globals_func_vm.lyte

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// args: -r
2+
// expected stdout:
3+
// assert(true)
4+
// assert(true)
5+
// vm execution successful
6+
7+
assert(cond: bool) → void
8+
9+
var global: i32
10+
11+
f {
12+
global = 42
13+
}
14+
15+
main {
16+
assert(global == 0)
17+
f()
18+
assert(global == 42)
19+
}

0 commit comments

Comments
 (0)