diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-21 20:29:34 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-21 20:29:34 +0100 |
commit | 19eee8ed7cf32de37afa53ce56c62376c880a5a8 (patch) | |
tree | 7a7e952d4f28af8b9ab7361093d40ac3a935c3ba /testsuite/bc.tests | |
parent | 5d57bc442dfebefdd7db37c04fe2c9f1343bd08d (diff) | |
download | busybox-w32-19eee8ed7cf32de37afa53ce56c62376c880a5a8.tar.gz busybox-w32-19eee8ed7cf32de37afa53ce56c62376c880a5a8.tar.bz2 busybox-w32-19eee8ed7cf32de37afa53ce56c62376c880a5a8.zip |
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 '')
-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 edff209bb..b3ce894ee 100755 --- a/testsuite/bc.tests +++ b/testsuite/bc.tests | |||
@@ -56,6 +56,21 @@ testing "bc for(;;)" \ | |||
56 | "2\n3\n2\n9\n" \ | 56 | "2\n3\n2\n9\n" \ |
57 | "" "i=2; for (;;) { 2; if(--i==0) break; 3; }; 9" | 57 | "" "i=2; for (;;) { 2; if(--i==0) break; 3; }; 9" |
58 | 58 | ||
59 | testing "bc for (;cond;)" \ | ||
60 | "bc" \ | ||
61 | "1\n2\n3\n9\n" \ | ||
62 | "" "i=0; for(;i<3;)++i; 9" | ||
63 | |||
64 | testing "bc for (;cond;upd)" \ | ||
65 | "bc" \ | ||
66 | "1\n2\n3\n9\n" \ | ||
67 | "" "i=1; for(;i<4;i++)i; 9" | ||
68 | |||
69 | testing "bc for (init;cond;upd)" \ | ||
70 | "bc" \ | ||
71 | "1\n2\n3\n9\n" \ | ||
72 | "" "for(i=1;i<4;i++)i; 9" | ||
73 | |||
59 | testing "bc define auto" \ | 74 | testing "bc define auto" \ |
60 | "bc" \ | 75 | "bc" \ |
61 | "8\n9\n" \ | 76 | "8\n9\n" \ |