From 19eee8ed7cf32de37afa53ce56c62376c880a5a8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 21 Dec 2018 20:29:34 +0100 Subject: 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 --- testsuite/bc.tests | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'testsuite/bc.tests') 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(;;)" \ "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" \ -- cgit v1.2.3