From c13a70c95828c60d78eff7ae711ec7304515a1f2 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 5 Jul 2024 10:10:09 +0200 Subject: [PATCH] Added operator precedence test --- tests/programs/precedence.q | 5 +++++ tests/programs/{exit.q => register-overlap.q} | 0 tests/programs_test.go | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/programs/precedence.q rename tests/programs/{exit.q => register-overlap.q} (100%) diff --git a/tests/programs/precedence.q b/tests/programs/precedence.q new file mode 100644 index 0000000..bfb4fd2 --- /dev/null +++ b/tests/programs/precedence.q @@ -0,0 +1,5 @@ +main() { + x := 2 + y := 3 + syscall(60, (x + y + (x + y) * (x + y)) / x / y + x + y) +} \ No newline at end of file diff --git a/tests/programs/exit.q b/tests/programs/register-overlap.q similarity index 100% rename from tests/programs/exit.q rename to tests/programs/register-overlap.q diff --git a/tests/programs_test.go b/tests/programs_test.go index 9505870..2a785e8 100644 --- a/tests/programs_test.go +++ b/tests/programs_test.go @@ -16,9 +16,10 @@ var programs = []struct { ExpectedExitCode int }{ {"empty.q", "", 0}, - {"square-sum.q", "", 25}, {"multi-calls.q", "", 9}, - {"exit.q", "", 9}, + {"precedence.q", "", 10}, + {"register-overlap.q", "", 9}, + {"square-sum.q", "", 25}, } func TestPrograms(t *testing.T) {