diff options
author | Adrian Thurston <thurston@complang.org> | 2011-11-06 19:45:02 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2011-11-06 19:45:02 +0000 |
commit | 8ebf5d732adaff2890abbf1934aba82b094d8c80 (patch) | |
tree | 1cef8e3cf0120edd16c3b6cda11b38b1948e10e8 /test | |
parent | bad054194b41e2eda252859016bba47958345f7e (diff) | |
download | colm-8ebf5d732adaff2890abbf1934aba82b094d8c80.tar.gz |
Added frameId to the call stack. Will use for stack unwinding so we can
properly cleanup on an exit (and eventually implement exceptions) refs #324.
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 6 | ||||
-rw-r--r-- | test/exit1.exp (renamed from test/exit.exp) | 0 | ||||
-rw-r--r-- | test/exit1.lm (renamed from test/exit.lm) | 2 | ||||
-rw-r--r-- | test/exit2.exp | 0 | ||||
-rw-r--r-- | test/exit2.lm | 20 | ||||
-rwxr-xr-x | test/runtests.mk | 25 |
6 files changed, 42 insertions, 11 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 2d8278ac..829be4e1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -14,7 +14,8 @@ TEST_CASES = \ mutualrec.lm \ argv1.lm \ argv2.lm \ - exit.lm \ + exit1.lm \ + exit2.lm \ rubyhere.lm \ translate1.lm \ translate2.lm \ @@ -132,7 +133,8 @@ EXPECTED_OUTPUT = \ counting4.exp \ div.exp \ dns.exp \ - exit.exp \ + exit1.exp \ + exit2.exp \ func.exp \ heredoc.exp \ island.exp \ diff --git a/test/exit.exp b/test/exit1.exp index 90be1f30..90be1f30 100644 --- a/test/exit.exp +++ b/test/exit1.exp diff --git a/test/exit.lm b/test/exit1.lm index 7005ae76..a41a71d5 100644 --- a/test/exit.lm +++ b/test/exit1.lm @@ -1,4 +1,4 @@ print( 'before\n' ) -exit( 1 ) +exit( 0 ) print( 'after\n' ) diff --git a/test/exit2.exp b/test/exit2.exp new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/exit2.exp diff --git a/test/exit2.lm b/test/exit2.lm new file mode 100644 index 00000000..3fa6694e --- /dev/null +++ b/test/exit2.lm @@ -0,0 +1,20 @@ + +int f3() +{ + I: int = 1 + exit( 0 ) +} + +int f2() +{ + I: int = 1 + f3() +} + +int f1() +{ + I: int = 1 + f2() +} + +f1() diff --git a/test/runtests.mk b/test/runtests.mk index 2a89db30..b5b2bb13 100755 --- a/test/runtests.mk +++ b/test/runtests.mk @@ -14,7 +14,8 @@ TESTS = \ mutualrec.lm \ argv1.lm \ argv2.lm \ - exit.lm \ + exit1.lm \ + exit2.lm \ rubyhere.lm \ translate1.lm \ translate2.lm \ @@ -72,7 +73,8 @@ DIFFS = \ mutualrec.diff \ argv1.diff \ argv2.diff \ - exit.diff \ + exit1.diff \ + exit2.diff \ rubyhere.diff \ translate1.diff \ translate2.diff \ @@ -221,14 +223,21 @@ argv2.out: argv2.bin argv2.bin: argv2.lm ./../colm/colm ./../colm/colm argv2.lm -exit.diff: exit.out exit.exp - @diff -u exit.exp exit.out > exit.diff || ( cat exit.diff; rm exit.diff ) +exit1.diff: exit1.out exit1.exp + @diff -u exit1.exp exit1.out > exit1.diff || ( cat exit1.diff; rm exit1.diff ) +exit2.diff: exit2.out exit2.exp + @diff -u exit2.exp exit2.out > exit2.diff || ( cat exit2.diff; rm exit2.diff ) -exit.out: exit.bin - ./exit.bin > exit.out +exit1.out: exit1.bin + ./exit1.bin > exit1.out -exit.bin: exit.lm ./../colm/colm - ./../colm/colm exit.lm +exit2.out: exit2.bin + ./exit2.bin > exit2.out + +exit1.bin: exit1.lm ./../colm/colm + ./../colm/colm exit1.lm +exit2.bin: exit2.lm ./../colm/colm + ./../colm/colm exit2.lm rubyhere.diff: rubyhere.out rubyhere.exp @diff -u rubyhere.exp rubyhere.out > rubyhere.diff || ( cat rubyhere.diff; rm rubyhere.diff ) |