diff options
64 files changed, 64 insertions, 8 deletions
diff --git a/test/add.myr b/test/add.myr index a1d5d86..5d264c1 100644 --- a/test/add.myr +++ b/test/add.myr @@ -1,3 +1,4 @@ +use std /* should exit with status 53 */ const main = { var a diff --git a/test/arityhigh.myr b/test/arityhigh.myr index 457f3a0..3cc4da1 100644 --- a/test/arityhigh.myr +++ b/test/arityhigh.myr @@ -1,3 +1,4 @@ +use std /* should fail because we call f with too many args */ const f = {a:int diff --git a/test/aritylow.myr b/test/aritylow.myr index b829907..6405f79 100644 --- a/test/aritylow.myr +++ b/test/aritylow.myr @@ -1,3 +1,4 @@ +use std /* should fail because we call f with too few args */ const f = {a:int, b:int, c:int diff --git a/test/array.myr b/test/array.myr index 76082a7..e27c611 100644 --- a/test/array.myr +++ b/test/array.myr @@ -1,3 +1,4 @@ +use std /* tests reading and writing to arrays. should exit with 7 */ const main = { var a : int[3] diff --git a/test/arrayaddr.myr b/test/arrayaddr.myr index 31d8b94..ec325f5 100644 --- a/test/arrayaddr.myr +++ b/test/arrayaddr.myr @@ -1,3 +1,4 @@ +use std /* tests taking the address of array elements. should exit with 42. */ const main = { var v : int[3] diff --git a/test/arraylen.myr b/test/arraylen.myr index 04ead33..7ac3b95 100644 --- a/test/arraylen.myr +++ b/test/arraylen.myr @@ -1,3 +1,4 @@ +use std /* checks that array lengths work. should exit with 12. */ const main = { var a : int[12] diff --git a/test/arraylit-ni.myr b/test/arraylit-ni.myr index 2cbc260..18835c3 100644 --- a/test/arraylit-ni.myr +++ b/test/arraylit-ni.myr @@ -1,3 +1,4 @@ +use std /* checks that we can create arrays without indexed initializers. exits with 2. */ const main = { var a = [1, 3, 2] diff --git a/test/bsr.myr b/test/bsr.myr index 8504a88..f7c738e 100644 --- a/test/bsr.myr +++ b/test/bsr.myr @@ -1,3 +1,4 @@ +use std /* should exit with status 5 */ const main = { var a = 42 diff --git a/test/call.myr b/test/call.myr index 2bf1205..22e6fbf 100644 --- a/test/call.myr +++ b/test/call.myr @@ -1,3 +1,4 @@ +use std /* checks that simple function calls work. should exit with 42. */ const f = { -> 21 diff --git a/test/callbig.myr b/test/callbig.myr index 343dc23..aba34e2 100644 --- a/test/callbig.myr +++ b/test/callbig.myr @@ -1,3 +1,4 @@ +use std /* checks that calls with large return values (ie, ones that don't fit in a * register) works correctly. Should exit with 42. */ type pair = struct diff --git a/test/condiffalse.myr b/test/condiffalse.myr index dce6426..e379c33 100644 --- a/test/condiffalse.myr +++ b/test/condiffalse.myr @@ -1,3 +1,4 @@ +use std /* checks that false conditions lead to the false branch of an if statement. * should exit with 9. */ var x = 5 diff --git a/test/condifrel.myr b/test/condifrel.myr index 32048cc..6ddb3ba 100644 --- a/test/condifrel.myr +++ b/test/condifrel.myr @@ -1,3 +1,4 @@ +use std /* checks if relatonal operators work. should exit with 9. */ var x = 3 var y = 9 diff --git a/test/condiftrue.myr b/test/condiftrue.myr index 47d044a..4a4beaf 100644 --- a/test/condiftrue.myr +++ b/test/condiftrue.myr @@ -1,3 +1,4 @@ +use std /* checks that true complex boolean conditions work. exits with 7. */ var x = 5 var y = 7 diff --git a/test/declmismatch.myr b/test/declmismatch.myr index 595c0be..fdb1321 100644 --- a/test/declmismatch.myr +++ b/test/declmismatch.myr @@ -1,3 +1,4 @@ +use std /* should fail to compile with a type error. char is incompatible with int. diff --git a/test/derefassign.myr b/test/derefassign.myr index 5b56ade..1250ac6 100644 --- a/test/derefassign.myr +++ b/test/derefassign.myr @@ -1,3 +1,4 @@ +use std /* should assign to v through pointer p, exiting with 123 */ const main = { var p diff --git a/test/div.myr b/test/div.myr index 2ed25be..f85643d 100644 --- a/test/div.myr +++ b/test/div.myr @@ -1,3 +1,4 @@ +use std /* should exit with status 42 */ const main = { var a diff --git a/test/fib.myr b/test/fib.myr index 141ffe2..ac0c874 100644 --- a/test/fib.myr +++ b/test/fib.myr @@ -1,3 +1,4 @@ +use std /* checks if recursive functions work. should return 21. */ const fib = {n if n <= 0 diff --git a/test/generic-in-const.myr b/test/generic-in-const.myr index 2dd01be..5198970 100644 --- a/test/generic-in-const.myr +++ b/test/generic-in-const.myr @@ -1,3 +1,4 @@ +use std /* should fail to compile because generic types are only allowed in generic declarations. diff --git a/test/generic.myr b/test/generic.myr index c9e2345..f173034 100644 --- a/test/generic.myr +++ b/test/generic.myr @@ -1,3 +1,4 @@ +use std /* checks that simple generics are specialized correctly. exits with 42. */ generic id = {a:@a -> a diff --git a/test/genericcall.myr b/test/genericcall.myr index f752c37..91cd3cc 100644 --- a/test/genericcall.myr +++ b/test/genericcall.myr @@ -1,3 +1,4 @@ +use std /* checks that generics can call non-generics. exits with 42. */ const f = { -> 42 diff --git a/test/global-arrayvar.myr b/test/global-arrayvar.myr index 7482f6e..ba42e05 100644 --- a/test/global-arrayvar.myr +++ b/test/global-arrayvar.myr @@ -1,3 +1,4 @@ +use std /* tests that global arrays work as expected, and are zero-initialized by * default. should exit with 7 */ var a : int[10] diff --git a/test/gsizeof.myr b/test/gsizeof.myr index 6322c06..15675e4 100644 --- a/test/gsizeof.myr +++ b/test/gsizeof.myr @@ -1,3 +1,4 @@ +use std /* checks that sizeof works on generics. exits with 5. */ generic sz = {a:@a -> sizeof(@a) diff --git a/test/infermismatch.myr b/test/infermismatch.myr index e606223..00c3541 100644 --- a/test/infermismatch.myr +++ b/test/infermismatch.myr @@ -1,3 +1,4 @@ +use std /* should fail to compile after infering that a is a float, b is a char, and the types are incompatible. diff --git a/test/log-and.myr b/test/log-and.myr index b8f1fb2..08c2ba6 100644 --- a/test/log-and.myr +++ b/test/log-and.myr @@ -1,3 +1,4 @@ +use std /* checks that evaluating a logical and to a bool works. should return 0. */ const main = { -> 0 && 1 diff --git a/test/log-or.myr b/test/log-or.myr index e11155a..25e1712 100644 --- a/test/log-or.myr +++ b/test/log-or.myr @@ -1,3 +1,4 @@ +use std /* checks that evaluating a logical or works. exits with 1. */ const main = { -> 0 || 1 diff --git a/test/loop.myr b/test/loop.myr index 113987a..6b8a18e 100644 --- a/test/loop.myr +++ b/test/loop.myr @@ -1,3 +1,4 @@ +use std /* checks that loops work. exits with 45. */ const main = { var i diff --git a/test/main.myr b/test/main.myr index cfdfe93..baf857b 100644 --- a/test/main.myr +++ b/test/main.myr @@ -1,2 +1,3 @@ +use std /* should exit with status 0 */ const main = {; -> 0 } diff --git a/test/match-badtypes.myr b/test/match-badtypes.myr index 1b43cfe..0635750 100644 --- a/test/match-badtypes.myr +++ b/test/match-badtypes.myr @@ -1,3 +1,4 @@ +use std /* should fail to compile because all types matched over should be diff --git a/test/matchargunion.myr b/test/matchargunion.myr index fcf65dc..933b52e 100644 --- a/test/matchargunion.myr +++ b/test/matchargunion.myr @@ -1,3 +1,4 @@ +use std /* checks pattern matching on unions with arguments. exits with 42. */ type u = union diff --git a/test/matchbind.myr b/test/matchbind.myr index 13112a7..f1bb52d 100644 --- a/test/matchbind.myr +++ b/test/matchbind.myr @@ -1,3 +1,4 @@ +use std /* checks that we can bind values in pattern matches. exits with 11. */ type u = union diff --git a/test/matchconst.myr b/test/matchconst.myr index 150c2d2..6dd68e5 100644 --- a/test/matchconst.myr +++ b/test/matchconst.myr @@ -1,3 +1,4 @@ +use std /* checks that matching works when comparing against constants, instead of just literals. exits with 88. */ /* some misc constants */ diff --git a/test/matchint.myr b/test/matchint.myr index 1cf607e..fb9d63f 100644 --- a/test/matchint.myr +++ b/test/matchint.myr @@ -1,3 +1,4 @@ +use std /* checks that matching integers works. exits with 84. */ const main = { var v diff --git a/test/matchunion.myr b/test/matchunion.myr index 683e985..734aa95 100644 --- a/test/matchunion.myr +++ b/test/matchunion.myr @@ -1,3 +1,4 @@ +use std /* checks that union matching works, at least on the key. exits with 84. */ type u = union diff --git a/test/mkunion.myr b/test/mkunion.myr index 7d58f31..159dc9f 100644 --- a/test/mkunion.myr +++ b/test/mkunion.myr @@ -1,3 +1,4 @@ +use std /* checks that union creation works. exits with 0. */ type u = union `Some int diff --git a/test/mod.myr b/test/mod.myr index a4a8e9c..7d8a8bf 100644 --- a/test/mod.myr +++ b/test/mod.myr @@ -1,3 +1,4 @@ +use std /* should exit with status 6 */ const main = { var a = 42 diff --git a/test/mul.myr b/test/mul.myr index 25e52e0..ee93478 100644 --- a/test/mul.myr +++ b/test/mul.myr @@ -1,3 +1,4 @@ +use std /* should exit with status 42 */ const main = { var a = 7 diff --git a/test/nestfn.myr b/test/nestfn.myr index 85787b1..bd75169 100644 --- a/test/nestfn.myr +++ b/test/nestfn.myr @@ -1,3 +1,4 @@ +use std /* checks that nested functions without environment capture work. should * exit with 42. */ const main = { diff --git a/test/neststruct.myr b/test/neststruct.myr index 1631f70..608e255 100644 --- a/test/neststruct.myr +++ b/test/neststruct.myr @@ -1,3 +1,4 @@ +use std /* tests that nested structs work. should exit with 3 */ type s1 = struct x : s2 diff --git a/test/occur.myr b/test/occur.myr index 909ccb9..30d535b 100644 --- a/test/occur.myr +++ b/test/occur.myr @@ -1,3 +1,4 @@ +use std /* checks that f is not an infinite type (ie, the type doesn't exist within itself). If 'f' typechecked, it's type would be: diff --git a/test/outparam-sl.myr b/test/outparam-sl.myr index 73894cd..c6da11e 100644 --- a/test/outparam-sl.myr +++ b/test/outparam-sl.myr @@ -1,3 +1,4 @@ +use std /* should assign a slice through an out param, returning exiting with 2 */ const arr = [1,2,3,4] const f = {out diff --git a/test/outparam.myr b/test/outparam.myr index dce00e1..167fa48 100644 --- a/test/outparam.myr +++ b/test/outparam.myr @@ -1,3 +1,4 @@ +use std /* should assign through an out pointer parameter, exiting with status 42 */ const f = {out *out = 42 diff --git a/test/overlappingif.myr b/test/overlappingif.myr index ac1dab2..fe4bd7f 100644 --- a/test/overlappingif.myr +++ b/test/overlappingif.myr @@ -1,3 +1,4 @@ +use std /* checks that if multiple if conditions are valid, only the first is * selected. should exit with 2. */ const main = { diff --git a/test/ptrpreinc.myr b/test/ptrpreinc.myr index f60e6aa..22a0706 100644 --- a/test/ptrpreinc.myr +++ b/test/ptrpreinc.myr @@ -1,3 +1,4 @@ +use std /* should preincrement through a pointer, exiting with status 9 */ const ppreinc = {p -> ++*p diff --git a/test/sizeof.myr b/test/sizeof.myr index 7ef4f45..69637c1 100644 --- a/test/sizeof.myr +++ b/test/sizeof.myr @@ -1,3 +1,4 @@ +use std /* checks that sizeof() works. exits with 4. */ const main = { -> sizeof(int) diff --git a/test/slice.myr b/test/slice.myr index b1b4958..b8b1678 100644 --- a/test/slice.myr +++ b/test/slice.myr @@ -1,3 +1,4 @@ +use std /* checks that taking slices of arrays works. should exit with 7 */ const main = { var a : int[3] diff --git a/test/slicelen.myr b/test/slicelen.myr index 000cc6c..9daed42 100644 --- a/test/slicelen.myr +++ b/test/slicelen.myr @@ -1,3 +1,4 @@ +use std /* checks that taking incomplete slices calculates the length correctly. * should exit with 5. */ const main = { diff --git a/test/str.myr b/test/str.myr index 70dc38b..4ec36b2 100644 --- a/test/str.myr +++ b/test/str.myr @@ -1,3 +1,4 @@ +use std /* checks that string literals are compiled correctly. exits with ascii 'f', ie, 102. */ const main = { diff --git a/test/struct.myr b/test/struct.myr index 8302245..2af3196 100644 --- a/test/struct.myr +++ b/test/struct.myr @@ -1,3 +1,4 @@ +use std /* test reading and writing to struct members. exits with 42. */ type pair = struct a : int diff --git a/test/struct1.myr b/test/struct1.myr index ae26ebd..c9c1880 100644 --- a/test/struct1.myr +++ b/test/struct1.myr @@ -1,3 +1,4 @@ +use std /* make sure assigning to a 1-element struct works; exit status should be 12 */ diff --git a/test/structarray.myr b/test/structarray.myr index 0849b90..594a706 100644 --- a/test/structarray.myr +++ b/test/structarray.myr @@ -1,3 +1,4 @@ +use std /* tests a struct containing an array. exit status should be 42. */ type t = struct a : int[42] diff --git a/test/structasn.myr b/test/structasn.myr index 6ed32fb..9a33304 100644 --- a/test/structasn.myr +++ b/test/structasn.myr @@ -1,3 +1,4 @@ +use std /* tests block assignment of structs. exits with 42.*/ type pair = struct a : int diff --git a/test/structptr.myr b/test/structptr.myr index df53a04..a5b389e 100644 --- a/test/structptr.myr +++ b/test/structptr.myr @@ -1,3 +1,4 @@ +use std /* tests reading and writing through a struct pointer. exits with 42. */ type pair = struct a : int diff --git a/test/structret.myr b/test/structret.myr index 1f19aa8..dc61ee2 100644 --- a/test/structret.myr +++ b/test/structret.myr @@ -1,3 +1,4 @@ +use std /* tests returning large structs. should exit with 42. */ type pair = struct a : int diff --git a/test/swidencast.myr b/test/swidencast.myr index b3ca205..82e5ebd 100644 --- a/test/swidencast.myr +++ b/test/swidencast.myr @@ -1,3 +1,4 @@ +use std /* sign extending cast. should exit with status 99 */ const main = { var u : int8 diff --git a/test/test.sh b/test/test.sh index 4b28f11..c38d8d2 100755 --- a/test/test.sh +++ b/test/test.sh @@ -14,14 +14,7 @@ function use { function build { rm -f $1 $1.o $1.s $1.use - echo " "$MC -I ../libstd $1.myr && \ - $MC -I ../libstd $1.myr && \ - echo " "$LD -o $1 $1.o -L../libstd -lstd && \ - if [ "x`uname`" = "xDarwin" ]; then - $LD -macosx_version_min 10.6 -o $1 $1.o -L../libstd -lstd - else - $LD -o $1 $1.o -L../libstd -lstd - fi + ../myrbuild/myrbuild -b $1 $1.myr -C../6/6m -I../libstd } function prints { diff --git a/test/trait-builtin.myr b/test/trait-builtin.myr index ba7034b..f6ab6b3 100644 --- a/test/trait-builtin.myr +++ b/test/trait-builtin.myr @@ -1,3 +1,4 @@ +use std /* checks that generic types with traits are compiled correctly. without the 'tcnum' trait on '@a', the '>' operator would not work within max. without the 'tctest' trait on '@a' in intlike_is42, diff --git a/test/trunccast.myr b/test/trunccast.myr index 16e9c24..daffaa0 100644 --- a/test/trunccast.myr +++ b/test/trunccast.myr @@ -1,3 +1,4 @@ +use std /* should truncate y when casting to x, exiting with status 15 */ const main = { var x : int8 diff --git a/test/tuple.myr b/test/tuple.myr index fc43aef..3402de0 100644 --- a/test/tuple.myr +++ b/test/tuple.myr @@ -1,3 +1,4 @@ +use std /* checks that we can create tuples and destructure them. exits with 42. */ const main = { var v diff --git a/test/tyoccur.myr b/test/tyoccur.myr index c5bf213..70d876f 100644 --- a/test/tyoccur.myr +++ b/test/tyoccur.myr @@ -1,3 +1,4 @@ +use std /* checks that types do not contain themselves inline, because that would lead to an infinite sized type. diff --git a/test/tyrec.myr b/test/tyrec.myr index 86b173e..b69466a 100644 --- a/test/tyrec.myr +++ b/test/tyrec.myr @@ -1,3 +1,4 @@ +use std /* we just want to see if this file compiles */ type foo = struct v : foo* diff --git a/test/union-extraarg.myr b/test/union-extraarg.myr index b34dc48..53e8b10 100644 --- a/test/union-extraarg.myr +++ b/test/union-extraarg.myr @@ -1,3 +1,4 @@ +use std /* should fail to compile becuse we're constructing a union that diff --git a/test/union-missingarg.myr b/test/union-missingarg.myr index c19f36e..2dda67c 100644 --- a/test/union-missingarg.myr +++ b/test/union-missingarg.myr @@ -1,3 +1,4 @@ +use std type u = union `Foo int ;; diff --git a/test/voidcall.myr b/test/voidcall.myr index c0313fd..6730ca1 100644 --- a/test/voidcall.myr +++ b/test/voidcall.myr @@ -1,3 +1,4 @@ +use std /* checks that calling void functions works. should compile, and not die when running. the exit value is 12, but it's really a dummy. */ const f = { diff --git a/test/zwidencast.myr b/test/zwidencast.myr index fd960f0..b7bba3e 100644 --- a/test/zwidencast.myr +++ b/test/zwidencast.myr @@ -1,3 +1,4 @@ +use std /* should zero-extend u when casting to v, returning 99 */ const main = { var u : uint8 |