shithub: mc

Download patch

ref: 6db6735df5f0e8d44c591c0ff8130c47f94c5d37
parent: 10b54e590ef8bfd54c5dc9712d0864db4be4e1ce
author: Ori Bernstein <[email protected]>
date: Mon Dec 16 11:48:38 EST 2013

Convert main() to effectively return void.

    Now, if we exit thorugh the end of main, we will ignore
    the return value, and call exit(0) from the start stub.

    If you want to exit with a different return value, you need
    to call std.exit(val)

--- a/libstd/start-linux.s
+++ b/libstd/start-linux.s
@@ -97,8 +97,8 @@
 
 	/* enter the main program */
 	call	main
-	/* exit */
-	movq	%rax,%rdi
+	/* exit(0) */
+        xorq	%rdi,%rdi
 	movq	$60,%rax
 	syscall
 
--- a/libstd/start-osx.s
+++ b/libstd/start-osx.s
@@ -98,7 +98,7 @@
 	/* enter the main program */
 	call	_main
 	/* exit */
-	movq	%rax,%rdi
+	xorq	%rdi,%rdi
 	movq	$0x2000001,%rax
 	syscall
 
--- a/test/add.myr
+++ b/test/add.myr
@@ -8,5 +8,5 @@
 	a = 42
 	b = 11
 	c = 0_0
-	-> a + b + c
+	std.exit(a + b + c)
 }
--- a/test/arityhigh.myr
+++ b/test/arityhigh.myr
@@ -1,9 +1,9 @@
 use std
 /* should fail because we call f with too many args */
 const f = {a:int
-
+	-> a
 }
 
 const main = {
-	-> f(1, 2, 3)
+	std.exit(f(1, 2, 3))
 }
--- a/test/aritylow.myr
+++ b/test/aritylow.myr
@@ -1,9 +1,9 @@
 use std
 /* should fail because we call f with too few args */
 const f = {a:int, b:int, c:int
-
+	-> a + b + c
 }
 
 const main = {
-	-> f(1, 2)
+	std.exit(f(1, 2))
 }
--- a/test/array.myr
+++ b/test/array.myr
@@ -5,5 +5,5 @@
 	a[0] = 3
 	a[1] = 4
 	a[2] = a[0] + a[1]
-	-> a[2]
+	std.exit(a[2])
 }
--- a/test/arrayaddr.myr
+++ b/test/arrayaddr.myr
@@ -6,6 +6,6 @@
 
 	v[1] = 42
 	p = &v[1]
-	-> p#
+	std.exit(p#)
 }
 
--- a/test/arraylen.myr
+++ b/test/arraylen.myr
@@ -3,5 +3,5 @@
 const main = {
 	var a : int[12]
 
-	-> a.len
+	std.exit(a.len)
 }
--- a/test/arraylit-ni.myr
+++ b/test/arraylit-ni.myr
@@ -2,5 +2,5 @@
 /* checks that we can create arrays without indexed initializers. exits with 2. */
 const main = {
 	var a = [1, 3, 2]
-	-> a[2]
+	std.exit(a[2])
 }
--- a/test/basicfloat.myr
+++ b/test/basicfloat.myr
@@ -6,5 +6,5 @@
 
 /* basic sanity check on floating point operations. should return 84. */
 const main = {
-	-> (42.0 + get42()) castto(int)
+	std.exit((42.0 + get42()) castto(int))
 }
--- a/test/bigliteral.myr
+++ b/test/bigliteral.myr
@@ -2,5 +2,4 @@
 
 const main = {
 	std.put("%l\n", 34359738368)
-	-> 0
 }
--- a/test/bsr.myr
+++ b/test/bsr.myr
@@ -2,5 +2,5 @@
 /* should exit with status 5 */
 const main = {
 	var a = 42
-	-> a >> 3
+	std.exit(a >> 3)
 }
--- a/test/call.myr
+++ b/test/call.myr
@@ -5,5 +5,5 @@
 }
 
 const main = {
-	-> f() + f()
+	std.exit(f() + f())
 }
--- a/test/callbig.myr
+++ b/test/callbig.myr
@@ -14,5 +14,5 @@
 	var s : pair
 	s.a = 12
 	s.b = 30
-	-> f(s)
+	std.exit(f(s))
 }
--- a/test/condiffalse.myr
+++ b/test/condiffalse.myr
@@ -1,12 +1,12 @@
 use std
 /* checks that false conditions lead to the false branch of an if statement.
 * should exit with 9. */
-var x = 5
-var y = 7
 const main = {
+	var x = 5, y = 7
+
 	if x == 7 && y == 5
-		-> 7
+		std.exit(7)
 	else
-		-> 9
+		std.exit(9)
 	;;
 }
--- a/test/condifrel.myr
+++ b/test/condifrel.myr
@@ -1,11 +1,11 @@
 use std
 /* checks if relatonal operators work. should exit with 9. */
-var x = 3
-var y = 9
 const main = {
+	var x = 3, y = 9
+
 	if x < 5 && y > 7
-		-> 7
+		std.exit(7)
 	else
-		-> 9
+		std.exit(9)
 	;;
 }
--- a/test/condiftrue.myr
+++ b/test/condiftrue.myr
@@ -1,11 +1,11 @@
 use std
 /* checks that true complex boolean conditions work. exits with 7. */
-var x = 5
-var y = 7
 const main = {
+	var x = 5, y = 7
+
 	if x == 5 && y == 7
-		-> 7
+		std.exit(7)
 	else
-		-> 9
+		std.exit(9)
 	;;
 }
--- a/test/derefassign.myr
+++ b/test/derefassign.myr
@@ -6,5 +6,5 @@
 
 	p = &v
 	p# = 123
-	-> v
+	std.exit(v)
 }
--- a/test/div.myr
+++ b/test/div.myr
@@ -6,5 +6,5 @@
 
 	a = 127
 	b = 3
-	-> a / b
+	std.exit(a / b)
 }
--- a/test/exportcycle.myr
+++ b/test/exportcycle.myr
@@ -9,5 +9,4 @@
 ;;
 
 const main = {
-	-> 0
 }
--- a/test/exportmain.myr
+++ b/test/exportmain.myr
@@ -10,5 +10,5 @@
 }
 
 const main = {
-	-> foo(42)
+	std.exit(foo(42))
 }
--- a/test/fib.myr
+++ b/test/fib.myr
@@ -11,6 +11,6 @@
 }
 
 const main = {
-	-> fib(8)
+	std.exit(fib(8))
 }
 
--- a/test/generic.myr
+++ b/test/generic.myr
@@ -6,6 +6,6 @@
 
 const main = {
 	id("adsf")
-	-> id(42)
+	std.exit(id(42))
 }
 
--- a/test/genericcall.myr
+++ b/test/genericcall.myr
@@ -10,6 +10,6 @@
 
 const main = {
 	id("adsf")
-	-> id(42)
+	std.exit(id(42))
 }
 
--- a/test/genericmatch.myr
+++ b/test/genericmatch.myr
@@ -7,7 +7,7 @@
 
 const main = {
 	match `Foo 123
-	| `Foo a:	-> 0xf
-	| `Bar:		-> 0x0
+	| `Foo a:	std.exit(0xf)
+	| `Bar:		std.exit(0x0)
 	;;
 }
--- a/test/genericrec.myr
+++ b/test/genericrec.myr
@@ -8,5 +8,4 @@
 
 const main = {
 	var v : list(int)
-	-> 0
 }
--- a/test/genericret.myr
+++ b/test/genericret.myr
@@ -11,7 +11,7 @@
 
 const main = {
 	match f()
-	| `None:	-> 42
+	| `None:	std.exit(42)
 	;;
-	-> 0
+	std.exit(0)
 }
--- a/test/generictype.myr
+++ b/test/generictype.myr
@@ -11,8 +11,8 @@
 
 	v = `Some 123
 	match v
-	| `None:	-> 1
-	| `Some 123:	-> 0
+	| `None:	std.exit(1)
+	| `Some 123:	std.exit(0)
 	;;
-	-> 60
+	std.exit(60)
 }
--- a/test/genericval.myr
+++ b/test/genericval.myr
@@ -2,7 +2,7 @@
 
 generic Foo : @a::(tctest,tcint,tcnum) = 42
 
-const main = {-> int
-	-> Foo
+const main = {
+	std.exit(Foo)
 }
 
--- a/test/global-arrayvar.myr
+++ b/test/global-arrayvar.myr
@@ -6,5 +6,5 @@
 const main = {
 	a[0] = 3
 	a[1] = 4
-	-> a[0] + a[1] + a[2] + a[3]
+	std.exit(a[0] + a[1] + a[2] + a[3])
 }
--- a/test/gsizeof.myr
+++ b/test/gsizeof.myr
@@ -5,5 +5,5 @@
 }
 
 const main = {
-	-> sz(123) + sz("asdf"[0])
+	std.exit(sz(123) + sz("asdf"[0]))
 }
--- a/test/helloworld.myr
+++ b/test/helloworld.myr
@@ -3,6 +3,5 @@
 
 const main = {args : byte[:][:]
 	std.write(1, "Hello-世界\n")
-	-> 0
 }
 
--- a/test/import-type.myr
+++ b/test/import-type.myr
@@ -4,6 +4,4 @@
 	var x : std.size
 	var y : std.off
 	var z : std.statbuf
-
-	-> 0
 }
--- a/test/infer-named.myr
+++ b/test/infer-named.myr
@@ -14,8 +14,8 @@
 
 	v = f(99)
 	match v
-	| `Foo:		-> 1
-	| `Bar x:	-> x
+	| `Foo:		std.exit(1)
+	| `Bar x:	std.exit(x)
 	;;
-	-> 2
+	std.exit(2)
 }
--- a/test/livearraylit.myr
+++ b/test/livearraylit.myr
@@ -4,7 +4,7 @@
 	var v
 
 	v = [foo(), 42, 123]
-	-> v[0]
+	std.exit(v[0])
 }
 
 const foo = {
--- a/test/livestructlit.myr
+++ b/test/livestructlit.myr
@@ -12,7 +12,7 @@
 	var v : t
 
 	v = [.a=foo(), .b=42, .c="foo"]
-	-> v.a
+	std.exit(v.a)
 }
 
 const foo = {
--- a/test/local-labels.myr
+++ b/test/local-labels.myr
@@ -2,9 +2,9 @@
 
 const main = {
 	goto foo
-	-> 123
+	std.exit(123)
 :foo
-	-> bar()
+	std.exit(bar())
 }
 
 const bar = {
--- a/test/log-and.myr
+++ b/test/log-and.myr
@@ -1,5 +1,5 @@
 use std
 /* checks that evaluating a logical and to a bool works. should return 0. */
 const main = {
-	-> 0 && 1
+	std.exit((0 && 1) castto(int))
 }
--- a/test/log-or.myr
+++ b/test/log-or.myr
@@ -1,5 +1,5 @@
 use std
 /* checks that evaluating a logical or works. exits with 1. */
 const main = {
-	-> 0 || 1
+	std.exit((0 || 1) castto(int))
 }
--- a/test/loop.myr
+++ b/test/loop.myr
@@ -8,5 +8,5 @@
 	for i = 0; i < 10; ++i
 		n += i
 	;;
-	-> n
+	std.exit(n)
 }
--- a/test/main.myr
+++ b/test/main.myr
@@ -1,3 +1,3 @@
 use std
 /* should exit with status 0 */
-const main = {; -> 0 }
+const main = {;}
--- a/test/match-badtypes.myr
+++ b/test/match-badtypes.myr
@@ -10,4 +10,5 @@
 	|"asdf":	123
 	|234567:	888
 	;;
+	std.exit(42)
 }
--- a/test/matchargunion.myr
+++ b/test/matchargunion.myr
@@ -12,10 +12,10 @@
 
 	v = `Int 123
 	match v
-	| `Int 127:	 -> 42
-	| `Int 123:	 -> 69
-	| `Chr 'a':	 -> 4
-	| `Nil:	 -> 6
+	| `Int 127:	 std.exit(42)
+	| `Int 123:	 std.exit(69)
+	| `Chr 'a':	 std.exit(4)
+	| `Nil:	 std.exit(6)
 	;;
 }
 
--- a/test/matcharray.myr
+++ b/test/matcharray.myr
@@ -5,8 +5,8 @@
 
 	match v
 	| [x, y, 10]:	
-		 -> x + y
+		 std.exit(x + y)
 	| _:	std.die("Wat")
 	;;
-	-> 0
+	std.exit(0)
 }
--- a/test/matchbind.myr
+++ b/test/matchbind.myr
@@ -12,10 +12,10 @@
 
 	v = `Int 8
 	match v
-	| `Int 127:	-> 42
-	| `Int x:	-> x
-	| `Chr 'a':	-> 4
-	| `Nil:		-> 6
+	| `Int 127:	std.exit(42)
+	| `Int x:	std.exit(x)
+	| `Chr 'a':	std.exit(4)
+	| `Nil:		std.exit(6)
 	;;
 }
 
--- a/test/matchconst.myr
+++ b/test/matchconst.myr
@@ -11,8 +11,8 @@
 
 	v = 8
 	match v
-	| Ca: 	-> 123
-	| Cb:	-> 88
-	| Cc:	-> 42
+	| Ca: 	std.exit(123)
+	| Cb:	std.exit(88)
+	| Cc:	std.exit(42)
 	;;
 }
--- a/test/matchint.myr
+++ b/test/matchint.myr
@@ -5,11 +5,11 @@
 
 	v = 12
 	match 12
-	| 1:	-> 42
-	| 2:	-> 81
-	| 3:	-> 123
-	| 4:	-> 99
-	| 12:	-> 84
-	| 6:	-> 18
+	| 1:	std.exit(42)
+	| 2:	std.exit(81)
+	| 3:	std.exit(123)
+	| 4:	std.exit(99)
+	| 12:	std.exit(84)
+	| 6:	std.exit(18)
 	;;
 }
--- a/test/matchmixed.myr
+++ b/test/matchmixed.myr
@@ -10,5 +10,5 @@
 	| `A:	std.put("Got a\n")
 	| `B:	std.put("Got b\n")
 	;;
-	-> 42
+	std.exit(42)
 }
--- a/test/matchstruct.myr
+++ b/test/matchstruct.myr
@@ -14,9 +14,9 @@
 	v.v3 = 10
 	match v
 	| [.v1 = x, .v2 = y, .v3 = 10]:	
-		 -> x + y
+		 std.exit(x + y)
 	| _:
 		std.die("Wat")
 	;;
-	-> 0
+	std.exit(0)
 }
--- a/test/matchtup.myr
+++ b/test/matchtup.myr
@@ -4,8 +4,8 @@
 	var v = (1, 2)
 
 	match v
-	| (1, x):	-> 40 + x
+	| (1, x):	std.exit(40 + x)
 	| _:	std.die("Wat")
 	;;
-	-> 0
+	std.exit(0)
 }
--- a/test/matchunion.myr
+++ b/test/matchunion.myr
@@ -13,9 +13,9 @@
 
 	v = `Foo
 	match v
-	| `Bar:	-> 42
-	| `Baz:	-> 81
-	| `Foo:	-> 84
-	| `Quux:	-> 123
+	| `Bar:	std.exit(42)
+	| `Baz:	std.exit(81)
+	| `Foo:	std.exit(84)
+	| `Quux:	std.exit(123)
 	;;
 }
--- a/test/matchunion_sl.myr
+++ b/test/matchunion_sl.myr
@@ -12,10 +12,9 @@
 
 	v = `Str "foo"
 	match v
-	| `Int 127: -> 42
+	| `Int 127: std.exit(42)
 	| `Str s: std.put("%s\n", s)
 	| `Nil:
 	;;
-	-> 0
 }
 
--- a/test/mkunion.myr
+++ b/test/mkunion.myr
@@ -9,5 +9,5 @@
 	var v
 
 	v = `Some 123
-	-> 0
+	std.exit(0)
 }
--- a/test/mod.myr
+++ b/test/mod.myr
@@ -3,5 +3,5 @@
 const main = {
 	var a = 42
 	var b = 9
-	-> a % b
+	std.exit(a % b)
 }
--- a/test/mul.myr
+++ b/test/mul.myr
@@ -4,5 +4,5 @@
 	var a = 7
 	var b = 2
 	var c = 3
-	-> a * b * c
+	std.exit(a * b * c)
 }
--- a/test/nestfn.myr
+++ b/test/nestfn.myr
@@ -5,5 +5,5 @@
 	const ret42 = {
 		-> 42
 	}
-	-> ret42()
+	std.exit(ret42())
 }
--- a/test/neststruct.myr
+++ b/test/neststruct.myr
@@ -17,5 +17,5 @@
 	s1.x.b = 2
 	s2 = s1.x
 
-	-> s2.a + s2.b
+	std.exit(s2.a + s2.b)
 }
--- a/test/occur.myr
+++ b/test/occur.myr
@@ -3,8 +3,8 @@
 doesn't exist within itself). If 'f' typechecked,
 it's type would be:
 
-f : (-> (-> (-> ... ad infinitum ...)))
+f : (std.exit((-> (-> ... ad infinitum ...))))
 */
 const f = {
-	-> f
+	std.exit(f)
 }
--- a/test/outparam-sl.myr
+++ b/test/outparam-sl.myr
@@ -9,5 +9,5 @@
 	var v
 
 	f(&v)
-	-> v[0]
+	std.exit(v[0])
 }
--- a/test/outparam.myr
+++ b/test/outparam.myr
@@ -9,5 +9,5 @@
 
 	v = 16
 	f(&v)
-	-> v
+	std.exit(v)
 }
--- a/test/overlappingif.myr
+++ b/test/overlappingif.myr
@@ -14,5 +14,5 @@
 	elif v & 0xffff != 0
 		x = 3
 	;;
-	-> x
+	std.exit(x)
 }
--- a/test/ptrpreinc.myr
+++ b/test/ptrpreinc.myr
@@ -7,6 +7,6 @@
 const main = {
 	var x = 8
 
-	-> ppreinc(&x)
+	std.exit(ppreinc(&x))
 }
 
--- a/test/sizeof.myr
+++ b/test/sizeof.myr
@@ -1,5 +1,5 @@
 use std
 /* checks that sizeof() works. exits with 4. */
 const main = {
-	-> sizeof(int)
+	std.exit(sizeof(int))
 }
--- a/test/slalloc.myr
+++ b/test/slalloc.myr
@@ -7,5 +7,5 @@
 	sl = std.slalloc(123)
 	sl[0] = 42
 	sl[122] = 1
-	-> sl.len
+	std.exit(sl.len)
 }
--- a/test/slgrow.myr
+++ b/test/slgrow.myr
@@ -8,5 +8,5 @@
 	sl[0] = 12
 	sl = std.slgrow(sl, 123)
 	sl[122] = 30
-	-> sl[0] + sl[122]
+	std.exit(sl[0] + sl[122])
 }
--- a/test/slice.myr
+++ b/test/slice.myr
@@ -8,5 +8,5 @@
 	s[0] = 3
 	s[1] = 4
 	s[2] = s[0] + s[1] + s.len
-	-> s[2]
+	std.exit(s[2])
 }
--- a/test/slicelen.myr
+++ b/test/slicelen.myr
@@ -6,5 +6,5 @@
 	var s
 
 	s = a[1:6]
-	-> s.len
+	std.exit(s.len)
 }
--- a/test/splitline.myr
+++ b/test/splitline.myr
@@ -1,6 +1,6 @@
 use std
 
 const main = {
-	-> 1 + \ /* ignored crap */
-	   2
+	std.exit(1 + \ /* ignored crap */
+	   	 2)
 }
--- a/test/sqrt.myr
+++ b/test/sqrt.myr
@@ -27,6 +27,6 @@
 }
 
 const main = {
-	-> sqrt(20.0) castto(int)
+	std.exit(sqrt(20.0) castto(int))
 }
 
--- a/test/stdopt-mk.myr
+++ b/test/stdopt-mk.myr
@@ -13,8 +13,8 @@
 	
 	v = f(123)
 	match v
-	| `std.Some x:	-> x
-	| `std.None:	-> 123
+	| `std.Some x:	std.exit(x)
+	| `std.None:	std.exit(123)
 	;;
 }
 
--- a/test/stdopt-none.myr
+++ b/test/stdopt-none.myr
@@ -6,8 +6,8 @@
 
 const main = {
 	match f()
-	| `std.Some x:	-> x
-	| `std.None:	-> 42
+	| `std.Some x:	std.exit(x)
+	| `std.None:	std.exit(42)
 	;;
 }
 
--- a/test/stdopt-some.myr
+++ b/test/stdopt-some.myr
@@ -2,8 +2,8 @@
 
 const main = {
 	match `std.Some 42
-	| `std.Some x:	-> x
-	| `std.None:	-> 1
+	| `std.Some x:	std.exit(x)
+	| `std.None:	std.exit(1)
 	;;
 }
 
--- a/test/stdopt-struct.myr
+++ b/test/stdopt-struct.myr
@@ -5,5 +5,5 @@
 ;;
 
 const main = {
-	-> 42
+	std.exit(42)
 }
--- a/test/str.myr
+++ b/test/str.myr
@@ -5,5 +5,5 @@
 	var str
 
 	str = "asdf"
-	-> str[3]
+	std.exit(str[3] castto(int))
 }
--- a/test/strsplit.myr
+++ b/test/strsplit.myr
@@ -8,5 +8,4 @@
 	for i = 0; i < sp.len; i++
 		std.put("%s\n", sp[i])
 	;;
-	-> 0
 }
--- a/test/strstrip.myr
+++ b/test/strstrip.myr
@@ -19,5 +19,4 @@
 	std.put("\"%s\"\n", std.strstrip(""))
 	std.put("\"%s\"\n", std.strfstrip(""))
 	std.put("\"%s\"\n", std.strrstrip(""))
-	-> 0
 }
--- a/test/strtab.myr
+++ b/test/strtab.myr
@@ -12,5 +12,5 @@
 	for i = 0; i < strtab.len; i++
 		std.put("%i: %s\n", i, strtab[i])
 	;;
-	-> 0
+	std.exit(0)
 }
--- a/test/struct.myr
+++ b/test/struct.myr
@@ -9,5 +9,5 @@
 	var s : pair
 	s.a = 12
 	s.b = 30
-	-> s.a + s.b
+	std.exit(s.a + s.b)
 }
--- a/test/struct1.myr
+++ b/test/struct1.myr
@@ -9,5 +9,5 @@
 const main = {
 	var s : val
 	s.a = 12
-	-> s.a
+	std.exit(s.a)
 }
--- a/test/structarray.myr
+++ b/test/structarray.myr
@@ -10,5 +10,5 @@
 	v.a[0] = 11
 	v.a[1] = 20
 
-	-> 2*v.a[0] + v.a[1]
+	std.exit(2*v.a[0] + v.a[1])
 }
--- a/test/structasn.myr
+++ b/test/structasn.myr
@@ -11,5 +11,5 @@
 	x.a = 12
 	x.b = 30
 	y = x
-	-> y.a + y.b
+	std.exit(y.a + y.b)
 }
--- a/test/structlit.myr
+++ b/test/structlit.myr
@@ -12,6 +12,6 @@
 	var v : t
 
 	v = [.a=42, .b='x', .c="foo"]
-	-> v.a
+	std.exit(v.a)
 }
 
--- a/test/structptr.myr
+++ b/test/structptr.myr
@@ -13,5 +13,5 @@
 const main = {
 	var s : pair
 	frob(&s)
-	-> s.a + s.b
+	std.exit(s.a + s.b)
 }
--- a/test/structret.myr
+++ b/test/structret.myr
@@ -17,5 +17,5 @@
 	var s : pair
 
 	s = f()
-	-> s.a + s.b
+	std.exit(s.a + s.b)
 }
--- a/test/swidencast.myr
+++ b/test/swidencast.myr
@@ -6,5 +6,5 @@
 	
 	u = 99
 	v = u castto(int32)
-	-> v
+	std.exit(v castto(int))
 }
--- a/test/trait-builtin.myr
+++ b/test/trait-builtin.myr
@@ -18,10 +18,11 @@
 generic intlike_is42 = {a : @a::(tcnum,tctest,tcint)
 	-> a == 42
 }
+
 const main = {
 	if intlike_is42(123)
-	    -> 16
+	    std.exit(16)
 	else
-	    -> max(12, 42)
+	    std.exit(max(12, 42))
 	;;
 }
--- a/test/trunccast.myr
+++ b/test/trunccast.myr
@@ -6,5 +6,5 @@
 
 	y = 9999
 	x = y castto(int8)
-	-> x % 73
+	std.exit((x % 73) castto(int))
 }
--- a/test/tuple.myr
+++ b/test/tuple.myr
@@ -9,5 +9,5 @@
 	x = 15
 	v = (x, x + 12)
 	(a, b) = v
-	-> a + b
+	std.exit(a + b)
 }
--- a/test/tyrec.myr
+++ b/test/tyrec.myr
@@ -6,5 +6,5 @@
 
 const main = {
 	var v : foo
-	-> 42
+	std.exit(42)
 }
--- a/test/usedef.myr
+++ b/test/usedef.myr
@@ -4,5 +4,5 @@
 */
 const main = {
 	var a : int
-	-> a
+	std.exit(a)
 }
--- a/test/voidcall.myr
+++ b/test/voidcall.myr
@@ -9,5 +9,5 @@
 
 const main = {
 	f()
-	-> 12
+	std.exit(12)
 }
--- a/test/zwidencast.myr
+++ b/test/zwidencast.myr
@@ -6,5 +6,5 @@
 	
 	u = 99
 	v = u castto(uint32)
-	-> v
+	std.exit(v castto(int))
 }