From 2d1f8aa20eec2091593d4c72c563a24f7c5b942c Mon Sep 17 00:00:00 2001 From: "ben.franksen" <ben.franksen@online.de> Date: Sun, 8 Jan 2012 17:55:46 +0000 Subject: [PATCH] test/snc: added nesting_depth.st This tests that for, while, if, and if/else statements can be nested to at least depth 40. --- test/compiler/nesting_depth.st | 179 +++++++++++++++++++++++++++++++++ test/compiler/snc_test.plt | 1 + 2 files changed, 180 insertions(+) create mode 100644 test/compiler/nesting_depth.st diff --git a/test/compiler/nesting_depth.st b/test/compiler/nesting_depth.st new file mode 100644 index 00000000..2cb6fcd1 --- /dev/null +++ b/test/compiler/nesting_depth.st @@ -0,0 +1,179 @@ +program nesting_depth + +unsigned char x = 0; + +ss test { + state test { + when() { + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) + for (;;) ; + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) + while (1) ; + if (x == 1) + if (x == 2) + if (x == 3) + if (x == 4) + if (x == 5) + if (x == 6) + if (x == 7) + if (x == 8) + if (x == 9) + if (x == 10) + if (x == 11) + if (x == 12) + if (x == 13) + if (x == 14) + if (x == 15) + if (x == 16) + if (x == 17) + if (x == 18) + if (x == 19) + if (x == 20) + if (x == 21) + if (x == 22) + if (x == 23) + if (x == 24) + if (x == 25) + if (x == 26) + if (x == 27) + if (x == 28) + if (x == 29) + if (x == 30) + if (x == 31) + if (x == 32) + if (x == 33) + if (x == 34) + if (x == 35) + if (x == 36) + if (x == 37) + if (x == 38) + if (x == 39) ; + else ; + if (x == 1) ; + else if (x == 2) ; + else if (x == 3) ; + else if (x == 4) ; + else if (x == 5) ; + else if (x == 6) ; + else if (x == 7) ; + else if (x == 8) ; + else if (x == 9) ; + else if (x == 10) ; + else if (x == 11) ; + else if (x == 12) ; + else if (x == 13) ; + else if (x == 14) ; + else if (x == 15) ; + else if (x == 16) ; + else if (x == 17) ; + else if (x == 18) ; + else if (x == 19) ; + else if (x == 20) ; + else if (x == 21) ; + else if (x == 22) ; + else if (x == 23) ; + else if (x == 24) ; + else if (x == 25) ; + else if (x == 26) ; + else if (x == 27) ; + else if (x == 28) ; + else if (x == 29) ; + else if (x == 30) ; + else if (x == 31) ; + else if (x == 32) ; + else if (x == 33) ; + else if (x == 34) ; + else if (x == 35) ; + else if (x == 36) ; + else if (x == 37) ; + else if (x == 38) ; + else if (x == 39) ; + } state test + } +} diff --git a/test/compiler/snc_test.plt b/test/compiler/snc_test.plt index 13b2fc7a..603eff27 100644 --- a/test/compiler/snc_test.plt +++ b/test/compiler/snc_test.plt @@ -9,6 +9,7 @@ my $success = { sync_not_monitored => 0, syncq_not_monitored => 0, include_windows_h => 0, + nesting_depth => 0, }; my $warning = { -- GitLab