diff options
author | Denys Vlasenko | 2018-12-21 20:29:34 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-12-21 20:29:34 +0100 |
commit | 19eee8ed7cf32de37afa53ce56c62376c880a5a8 (patch) | |
tree | 7a7e952d4f28af8b9ab7361093d40ac3a935c3ba /testsuite | |
parent | 5d57bc442dfebefdd7db37c04fe2c9f1343bd08d (diff) | |
download | busybox-19eee8ed7cf32de37afa53ce56c62376c880a5a8.zip busybox-19eee8ed7cf32de37afa53ce56c62376c880a5a8.tar.gz |
bc: fix for() to not leave data on stack
function old new delta
zbc_parse_stmt_possibly_auto 1665 1697 +32
zbc_vm_process 672 701 +29
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 61/0) Total: 61 bytes
text data bss dec hex filename
981656 485 7296 989437 f18fd busybox_old
981748 485 7296 989529 f1959 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/bc.tests | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/bc.tests b/testsuite/bc.tests index edff209..b3ce894 100755 --- a/testsuite/bc.tests +++ b/testsuite/bc.tests @@ -56,6 +56,21 @@ testing "bc for(;;)" \ "2\n3\n2\n9\n" \ "" "i=2; for (;;) { 2; if(--i==0) break; 3; }; 9" +testing "bc for (;cond;)" \ + "bc" \ + "1\n2\n3\n9\n" \ + "" "i=0; for(;i<3;)++i; 9" + +testing "bc for (;cond;upd)" \ + "bc" \ + "1\n2\n3\n9\n" \ + "" "i=1; for(;i<4;i++)i; 9" + +testing "bc for (init;cond;upd)" \ + "bc" \ + "1\n2\n3\n9\n" \ + "" "for(i=1;i<4;i++)i; 9" + testing "bc define auto" \ "bc" \ "8\n9\n" \ |