From d1507101695f6bad35a61c4770b7d3913597ac16 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 30 Jun 2021 12:23:51 +0200 Subject: awk: allow empty fuinctions with no arguments, disallow function redefinitions function old new delta .rodata 103681 103700 +19 parse_program 303 307 +4 evaluate 3145 3141 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 23/-4) Total: 19 bytes Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'testsuite') diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 6e35d33dd..873cc3680 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -44,6 +44,16 @@ testing "awk handles empty function f(arg){}" \ "L1\n\nL2\n\n" \ "" "" +prg=' +function empty_fun(){} +END {empty_fun() + print "Ok" +}' +testing "awk handles empty function f(){}" \ + "awk '$prg'" \ + "Ok\n" \ + "" "" + prg=' function outer_fun() { return 1 -- cgit v1.2.3