From 5f62de11c2c5f787c3d4bc374db0a4dfa0e2fe1a Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Tue, 13 Mar 2018 13:33:30 +0000 Subject: [PATCH] Add failing test for multiple gotos that are all in tail position. --- tests/SixtyPical Analysis.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/SixtyPical Analysis.md b/tests/SixtyPical Analysis.md index c9d2431..118af3f 100644 --- a/tests/SixtyPical Analysis.md +++ b/tests/SixtyPical Analysis.md @@ -2231,6 +2231,22 @@ Calling the vector does indeed trash the things the vector says it does. | } ? IllegalJumpError + | routine bar trashes x, z, n { + | ld x, 200 + | } + | + | routine main trashes x, z, n { + | ld x, 0 + | if z { + | ld x, 1 + | goto bar + | } else { + | ld x, 0 + | goto bar + | } + | } + = ok + Can't `goto` a routine that outputs or trashes more than the current routine. | routine bar trashes x, y, z, n {