Add failing test for multiple gotos that are all in tail position.
Chris Pressey
4 years ago
2230 | 2230 | | } |
2231 | 2231 | ? IllegalJumpError |
2232 | 2232 | |
2233 | | routine bar trashes x, z, n { | |
2234 | | ld x, 200 | |
2235 | | } | |
2236 | | | |
2237 | | routine main trashes x, z, n { | |
2238 | | ld x, 0 | |
2239 | | if z { | |
2240 | | ld x, 1 | |
2241 | | goto bar | |
2242 | | } else { | |
2243 | | ld x, 0 | |
2244 | | goto bar | |
2245 | | } | |
2246 | | } | |
2247 | = ok | |
2248 | ||
2233 | 2249 | Can't `goto` a routine that outputs or trashes more than the current routine. |
2234 | 2250 | |
2235 | 2251 | | routine bar trashes x, y, z, n { |