From 8c1e72359626789b1b98aeac0225d73d1336bb59 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 22 Dec 2018 01:34:10 +0100 Subject: bc: unbreak read(), remove checks for nested read() function old new delta zbc_parse_pushSTR - 65 +65 common_parse_expr - 32 +32 bc_error_nested_read_call 10 - -10 bc_parse_expr_empty_ok 1977 1963 -14 zdc_parse_expr 635 615 -20 zcommon_parse_expr 32 - -32 zbc_program_exec 4064 4023 -41 bc_parse_pushSTR 65 - -65 ------------------------------------------------------------------------------ (add/remove: 2/3 grow/shrink: 0/3 up/down: 97/-182) Total: -85 bytes text data bss dec hex filename 981661 485 7296 989442 f1902 busybox_old 981540 485 7296 989321 f1889 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 b3ce894ee..c84a2987c 100755 --- a/testsuite/bc.tests +++ b/testsuite/bc.tests @@ -31,6 +31,21 @@ testing "bc string 1" \ "STR\n" \ "" "\"STR\n\"" +testing "bc read() 4" \ + "bc input" \ + "4\n" \ + "read();halt" "4" + +testing "bc read()^2" \ + "bc input" \ + "16\n" \ + "read()^2;halt" "4\n" + +testing "bc read()*read()" \ + "bc input" \ + "20\n" \ + "read()*read();halt" "4\n5" + testing "bc if 0 else" \ "bc" \ "2\n9\n" \ -- cgit v1.2.3