aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pc/ChangeLog4
-rw-r--r--pc/Makefile.tst8
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am10
-rw-r--r--test/Makefile.in10
-rw-r--r--test/indirectbuiltin2.awk29
-rw-r--r--test/indirectbuiltin2.ok6
7 files changed, 72 insertions, 0 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 2ca19739..e75df278 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2022-02-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Regenerated.
+
2022-01-05 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 5569e571..f25e887b 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -196,6 +196,7 @@ GAWK_EXT_TESTS = \
gnuops2 gnuops3 gnureops gsubind icasefs icasers id igncdym igncfs \
ignrcas2 ignrcas4 ignrcase incdupe incdupe2 incdupe3 incdupe4 \
incdupe5 incdupe6 incdupe7 include include2 indirectbuiltin \
+ indirectbuiltin2 \
indirectcall indirectcall2 inf-nan-torture intarray iolint \
isarrayunset lint lintexp lintindex lintint lintlength lintplus \
lintold lintset lintwarn manyfiles match1 match2 match3 mbstr1 \
@@ -1235,6 +1236,13 @@ argcasfile:
@echo $@
@-$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+indirectbuiltin2:
+ @echo $@
+ @-for test in 0 1 2 3 4 5 ; do \
+ $(AWK) -v test=$$test -f "$(srcdir)"/$@.awk ; \
+ done > _$@ 2>&1 || exit 0
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/ChangeLog b/test/ChangeLog
index 7db73f3c..c45b2f43 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2022-02-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): indirectbuiltin2, new test.
+ * indirectbuiltin2.awk, indirectbuiltin2.ok: New files.
+
2022-01-05 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): nsidentifier, new test.
diff --git a/test/Makefile.am b/test/Makefile.am
index abd1fc00..424aaa82 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -567,6 +567,8 @@ EXTRA_DIST = \
include.ok \
indirectbuiltin.awk \
indirectbuiltin.ok \
+ indirectbuiltin2.awk \
+ indirectbuiltin2.ok \
indirectcall2.awk \
indirectcall2.ok \
indirectcall.awk \
@@ -1449,6 +1451,7 @@ GAWK_EXT_TESTS = \
gnuops2 gnuops3 gnureops gsubind icasefs icasers id igncdym igncfs \
ignrcas2 ignrcas4 ignrcase incdupe incdupe2 incdupe3 incdupe4 \
incdupe5 incdupe6 incdupe7 include include2 indirectbuiltin \
+ indirectbuiltin2 \
indirectcall indirectcall2 inf-nan-torture intarray iolint \
isarrayunset lint lintexp lintindex lintint lintlength lintplus \
lintold lintset lintwarn manyfiles match1 match2 match3 mbstr1 \
@@ -2489,6 +2492,13 @@ argcasfile:
@-$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+indirectbuiltin2:
+ @echo $@
+ @-for test in 0 1 2 3 4 5 ; do \
+ $(AWK) -v test=$$test -f "$(srcdir)"/$@.awk ; \
+ done > _$@ 2>&1 || exit 0
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index ab45c3aa..82b60902 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -833,6 +833,8 @@ EXTRA_DIST = \
include.ok \
indirectbuiltin.awk \
indirectbuiltin.ok \
+ indirectbuiltin2.awk \
+ indirectbuiltin2.ok \
indirectcall2.awk \
indirectcall2.ok \
indirectcall.awk \
@@ -1715,6 +1717,7 @@ GAWK_EXT_TESTS = \
gnuops2 gnuops3 gnureops gsubind icasefs icasers id igncdym igncfs \
ignrcas2 ignrcas4 ignrcase incdupe incdupe2 incdupe3 incdupe4 \
incdupe5 incdupe6 incdupe7 include include2 indirectbuiltin \
+ indirectbuiltin2 \
indirectcall indirectcall2 inf-nan-torture intarray iolint \
isarrayunset lint lintexp lintindex lintint lintlength lintplus \
lintold lintset lintwarn manyfiles match1 match2 match3 mbstr1 \
@@ -2937,6 +2940,13 @@ argcasfile:
@echo $@
@-$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+indirectbuiltin2:
+ @echo $@
+ @-for test in 0 1 2 3 4 5 ; do \
+ $(AWK) -v test=$$test -f "$(srcdir)"/$@.awk ; \
+ done > _$@ 2>&1 || exit 0
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/indirectbuiltin2.awk b/test/indirectbuiltin2.awk
new file mode 100644
index 00000000..6409f91a
--- /dev/null
+++ b/test/indirectbuiltin2.awk
@@ -0,0 +1,29 @@
+@load "ordchr"
+
+BEGIN {
+ o = "ord" # check stack for indirect call of ext function
+ l = "length" # check bad args for function of 1 argument
+ m = "match" # check bad args for function of 3-4 argument
+ s = "systime" # check bad args for function of 0 arguments
+
+ switch (test) {
+ case 0:
+ print "indirect, " @o("A")
+ break
+ case 1:
+ print @l()
+ break
+ case 2:
+ print @l("a", "b")
+ break
+ case 3:
+ print @m(@/foo/)
+ break
+ case 4:
+ print @m(@/foo/, "bar", a, b)
+ break
+ case 5:
+ print @s("xxx")
+ break
+ }
+}
diff --git a/test/indirectbuiltin2.ok b/test/indirectbuiltin2.ok
new file mode 100644
index 00000000..dfb2005e
--- /dev/null
+++ b/test/indirectbuiltin2.ok
@@ -0,0 +1,6 @@
+indirect, 65
+gawk: ./indirectbuiltin2.awk:14: fatal: length: called with 0 arguments
+gawk: ./indirectbuiltin2.awk:17: fatal: length: called with 2 arguments
+gawk: ./indirectbuiltin2.awk:20: fatal: indirect call to match requires two or three arguments
+gawk: ./indirectbuiltin2.awk:23: fatal: indirect call to match requires two or three arguments
+gawk: ./indirectbuiltin2.awk:26: fatal: systime: called with 1 arguments