summaryrefslogtreecommitdiff
path: root/test/structptr.myr
blob: e49ccfbc3d6bc450f901ced49cf12d43c38dfab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std
/* tests reading and writing through a struct pointer. exits with 42. */
type pair = struct
	a : int
	b : int
;;

const frob = {s
	s.a = 12
	s.b = 30
}

const main = {
	var s : pair
	frob(&s)
	std.exit(s.a + s.b)
}