Added nested calls test

This commit is contained in:
Eduard Urbach 2024-07-05 11:56:57 +02:00
parent c13a70c958
commit 099ee729d4
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
4 changed files with 13 additions and 9 deletions

View File

@ -1,7 +0,0 @@
main() {
syscall(60, f(1) + f(2) + f(3))
}
f(x) {
return x + 1
}

View File

@ -0,0 +1,11 @@
main() {
exit(f(f(f(1))))
}
exit(code) {
syscall(60, code)
}
f(x) {
return x + 1
}

View File

@ -16,10 +16,10 @@ var programs = []struct {
ExpectedExitCode int ExpectedExitCode int
}{ }{
{"empty.q", "", 0}, {"empty.q", "", 0},
{"multi-calls.q", "", 9},
{"precedence.q", "", 10}, {"precedence.q", "", 10},
{"register-overlap.q", "", 9},
{"square-sum.q", "", 25}, {"square-sum.q", "", 25},
{"chained-calls.q", "", 9},
{"nested-calls.q", "", 4},
} }
func TestPrograms(t *testing.T) { func TestPrograms(t *testing.T) {