diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-04 13:58:46 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-02-14 14:40:57 +0100 |
commit | 5b35d599e8c47e2d3ecc4a44ef742973c1f8aa83 (patch) | |
tree | ee04752886c6818fd8af1b6c3273032948921bd7 /testsuite | |
parent | c7679c759a1f90b96fa31bdbdd94cf62e0ae344e (diff) | |
download | busybox-w32-5b35d599e8c47e2d3ecc4a44ef742973c1f8aa83.tar.gz busybox-w32-5b35d599e8c47e2d3ecc4a44ef742973c1f8aa83.tar.bz2 busybox-w32-5b35d599e8c47e2d3ecc4a44ef742973c1f8aa83.zip |
bc: support void functions (GNU compat)
function old new delta
xc_program_print - 689 +689
zxc_vm_process 814 869 +55
zxc_program_exec 4098 4116 +18
zxc_program_assign 385 392 +7
bc_result_free 43 46 +3
zxc_program_binOpPrep 243 245 +2
zdc_program_execStr 518 520 +2
zxc_program_print 683 - -683
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 6/0 up/down: 776/-683) Total: 93 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/bc.tests | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/bc.tests b/testsuite/bc.tests index 0a8222be6..3fde60a2c 100755 --- a/testsuite/bc.tests +++ b/testsuite/bc.tests | |||
@@ -123,6 +123,23 @@ testing "bc define with body on next line" \ | |||
123 | "8\n9\n" \ | 123 | "8\n9\n" \ |
124 | "" "define w()\n{ auto z; return 8; }\nw()\n9" | 124 | "" "define w()\n{ auto z; return 8; }\nw()\n9" |
125 | 125 | ||
126 | testing "bc void function" \ | ||
127 | "bc" \ | ||
128 | "void9\n" \ | ||
129 | "" "define void w() {print \"void\"}\nw()\n9" | ||
130 | |||
131 | # Extra POSIX compat - GNU bc does not allow this | ||
132 | testing "bc function named 'void'" \ | ||
133 | "bc" \ | ||
134 | "void0\n9\n" \ | ||
135 | "" "define void() {print \"void\"}\nvoid()\n9" | ||
136 | |||
137 | # Extra POSIX compat - GNU bc does not allow this | ||
138 | testing "bc variable named 'void'" \ | ||
139 | "bc" \ | ||
140 | "6\n9\n" \ | ||
141 | "" "void=6\nvoid\n9" | ||
142 | |||
126 | testing "bc if(cond)<NL>" \ | 143 | testing "bc if(cond)<NL>" \ |
127 | "bc" \ | 144 | "bc" \ |
128 | "9\n" \ | 145 | "9\n" \ |