diff --git a/tests/16_nesting.c b/tests/16_nesting.c new file mode 100644 index 0000000..c239aa3 --- /dev/null +++ b/tests/16_nesting.c @@ -0,0 +1,12 @@ +int x, y, z; + +for (x = 0; x < 2; x++) +{ + for (y = 0; y < 3; y++) + { + for (z = 0; z < 3; z++) + { + printf("%d %d %d\n", x, y, z); + } + } +} diff --git a/tests/16_nesting.expect b/tests/16_nesting.expect new file mode 100644 index 0000000..625ee13 --- /dev/null +++ b/tests/16_nesting.expect @@ -0,0 +1,18 @@ +0 0 0 +0 0 1 +0 0 2 +0 1 0 +0 1 1 +0 1 2 +0 2 0 +0 2 1 +0 2 2 +1 0 0 +1 0 1 +1 0 2 +1 1 0 +1 1 1 +1 1 2 +1 2 0 +1 2 1 +1 2 2 diff --git a/tests/Makefile b/tests/Makefile index 1c82a7d..16294ed 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -11,7 +11,8 @@ TESTS= 00_assignment.test \ 10_pointer.test \ 12_hashdefine.test \ 13_integer_literals.test \ - 14_if.test + 14_if.test \ + 16_nesting.test %.test: %.expect %.c @echo Test: $*...