summaryrefslogtreecommitdiff
path: root/checks
diff options
context:
space:
mode:
Diffstat (limited to 'checks')
-rw-r--r--checks/01.define5
-rw-r--r--checks/02.arguments5
-rw-r--r--checks/02.define13
-rw-r--r--checks/03.arguments7
-rw-r--r--checks/04.arguments5
-rw-r--r--checks/05.arguments5
-rw-r--r--checks/06.arguments5
-rw-r--r--checks/06.pseudo_argu9
-rw-r--r--checks/07.pseudo_argu5
-rw-r--r--checks/08.pseudo_argu5
-rw-r--r--checks/09.pseudo_argu11
-rw-r--r--checks/10.pseudo_argu5
-rw-r--r--checks/11.pseudo_argu5
-rw-r--r--checks/11.undefine11
-rw-r--r--checks/12.defn7
-rw-r--r--checks/12.undefine11
-rw-r--r--checks/13.defn7
-rw-r--r--checks/13.pushdef17
-rw-r--r--checks/14.defn9
-rw-r--r--checks/14.pushdef17
-rw-r--r--checks/15.indir7
-rw-r--r--checks/15.pushdef17
-rw-r--r--checks/16.ifdef7
-rw-r--r--checks/16.pushdef17
-rw-r--r--checks/17.ifelse9
-rw-r--r--checks/17.indir7
-rw-r--r--checks/18.ifdef7
-rw-r--r--checks/18.ifelse3
-rw-r--r--checks/19.ifelse9
-rw-r--r--checks/19.loops5
-rw-r--r--checks/20.ifelse3
-rw-r--r--checks/20.loops10
-rw-r--r--checks/21.dumpdef9
-rw-r--r--checks/21.loops7
-rw-r--r--checks/22.loops10
-rw-r--r--checks/22.trace13
-rw-r--r--checks/23.dnl4
-rw-r--r--checks/23.dumpdef9
-rw-r--r--checks/24.changequote7
-rw-r--r--checks/24.trace13
-rw-r--r--checks/25.changequote7
-rw-r--r--checks/25.dnl4
-rw-r--r--checks/26.changequote9
-rw-r--r--checks/27.changecom11
-rw-r--r--checks/27.changequote7
-rw-r--r--checks/28.changecom7
-rw-r--r--checks/28.changequote9
-rw-r--r--checks/29.changecom11
-rw-r--r--checks/29.m4wrap9
-rw-r--r--checks/30.changecom7
-rw-r--r--checks/30.include6
-rw-r--r--checks/31.changesynta11
-rw-r--r--checks/31.include8
-rw-r--r--checks/32.changesynta11
-rw-r--r--checks/32.include8
-rw-r--r--checks/33.changesynta9
-rw-r--r--checks/33.divert9
-rw-r--r--checks/34.changesynta9
-rw-r--r--checks/34.divert6
-rw-r--r--checks/35.changesynta15
-rw-r--r--checks/35.undivert11
-rw-r--r--checks/36.changesynta5
-rw-r--r--checks/36.undivert13
-rw-r--r--checks/37.changesynta13
-rw-r--r--checks/37.undivert9
-rw-r--r--checks/38.divnum13
-rw-r--r--checks/38.m4wrap9
-rw-r--r--checks/39.cleardiv7
-rw-r--r--checks/39.include6
-rw-r--r--checks/40.cleardiv4
-rw-r--r--checks/40.include8
-rw-r--r--checks/41.include8
-rw-r--r--checks/41.len5
-rw-r--r--checks/42.divert9
-rw-r--r--checks/42.index5
-rw-r--r--checks/43.divert6
-rw-r--r--checks/43.regexp5
-rw-r--r--checks/44.regexp3
-rw-r--r--checks/44.undivert11
-rw-r--r--checks/45.substr5
-rw-r--r--checks/45.undivert13
-rw-r--r--checks/46.translit7
-rw-r--r--checks/46.undivert9
-rw-r--r--checks/47.divnum13
-rw-r--r--checks/47.patsubst11
-rw-r--r--checks/48.cleardiv7
-rw-r--r--checks/48.patsubst9
-rw-r--r--checks/49.cleardiv4
-rw-r--r--checks/49.format5
-rw-r--r--checks/50.incr5
-rw-r--r--checks/50.len5
-rw-r--r--checks/51.eval18
-rw-r--r--checks/51.index5
-rw-r--r--checks/52.eval11
-rw-r--r--checks/52.regexp5
-rw-r--r--checks/53.esyscmd6
-rw-r--r--checks/53.regexp3
-rw-r--r--checks/54.substr5
-rw-r--r--checks/54.sysval9
-rw-r--r--checks/55.errprint5
-rw-r--r--checks/55.translit7
-rw-r--r--checks/56.errprint5
-rw-r--r--checks/56.patsubst11
-rw-r--r--checks/57.m4exit6
-rw-r--r--checks/57.patsubst9
-rw-r--r--checks/58.format5
-rw-r--r--checks/59.incr5
-rw-r--r--checks/60.eval18
-rw-r--r--checks/61.eval11
-rw-r--r--checks/62.esyscmd6
-rw-r--r--checks/63.sysval9
-rw-r--r--checks/64.errprint5
-rw-r--r--checks/65.errprint5
-rw-r--r--checks/66.m4exit6
-rw-r--r--checks/Makefile.am16
-rw-r--r--checks/Makefile.in76
-rwxr-xr-xchecks/check-them51
-rw-r--r--checks/foo1
-rwxr-xr-xchecks/get-them68
-rw-r--r--checks/incl.m43
-rw-r--r--checks/stamp-checks0
121 files changed, 1143 insertions, 0 deletions
diff --git a/checks/01.define b/checks/01.define
new file mode 100644
index 00000000..7a044c01
--- /dev/null
+++ b/checks/01.define
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:939: Origin of test
+define(`foo', `Hello world.')
+dnl @result{}
+foo
+dnl @result{}Hello world.
diff --git a/checks/02.arguments b/checks/02.arguments
new file mode 100644
index 00000000..0d459123
--- /dev/null
+++ b/checks/02.arguments
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:963: Origin of test
+define(`exch', `$2, $1')
+dnl @result{}
+exch(arg1, arg2)
+dnl @result{}arg2, arg1
diff --git a/checks/02.define b/checks/02.define
new file mode 100644
index 00000000..de8bc66d
--- /dev/null
+++ b/checks/02.define
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:905: Origin of test
+define(`array', `defn(format(``array[%d]'', `$1'))')
+dnl @result{}
+define(`array_set', `define(format(``array[%d]'', `$1'), `$2')')
+dnl @result{}
+array_set(4, `array element no. 4')
+dnl @result{}
+array_set(17, `array element no. 17')
+dnl @result{}
+array(4)
+dnl @result{}array element no. 4
+array(eval(10+7))
+dnl @result{}array element no. 17
diff --git a/checks/03.arguments b/checks/03.arguments
new file mode 100644
index 00000000..9117964b
--- /dev/null
+++ b/checks/03.arguments
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:973: Origin of test
+define(`exch', `$2, $1')
+dnl @result{}
+define(exch(``expansion text'', ``macro''))
+dnl @result{}
+macro
+dnl @result{}expansion text
diff --git a/checks/04.arguments b/checks/04.arguments
new file mode 100644
index 00000000..8d325ac4
--- /dev/null
+++ b/checks/04.arguments
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:993: Origin of test
+define(`test', ``Macro name: $0'')
+dnl @result{}
+test
+dnl @result{}Macro name: test
diff --git a/checks/05.arguments b/checks/05.arguments
new file mode 100644
index 00000000..aaed75e0
--- /dev/null
+++ b/checks/05.arguments
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:1003: Origin of test
+define(`foo', `This is macro `foo'.')
+dnl @result{}
+foo
+dnl @result{}This is macro foo.
diff --git a/checks/06.arguments b/checks/06.arguments
new file mode 100644
index 00000000..b866e6c9
--- /dev/null
+++ b/checks/06.arguments
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:974: Origin of test
+define(`foo', `This is macro `foo'.')
+dnl @result{}
+foo
+dnl @result{}This is macro foo.
diff --git a/checks/06.pseudo_argu b/checks/06.pseudo_argu
new file mode 100644
index 00000000..8c1f9dfd
--- /dev/null
+++ b/checks/06.pseudo_argu
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1027: Origin of test
+define(`nargs', `$#')
+dnl @result{}
+nargs
+dnl @result{}0
+nargs()
+dnl @result{}1
+nargs(arg1, arg2, arg3)
+dnl @result{}3
diff --git a/checks/07.pseudo_argu b/checks/07.pseudo_argu
new file mode 100644
index 00000000..0517066c
--- /dev/null
+++ b/checks/07.pseudo_argu
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:1041: Origin of test
+define(`echo', `$*')
+dnl @result{}
+echo(arg1, arg2, arg3 , arg4)
+dnl @result{}arg1,arg2,arg3 ,arg4
diff --git a/checks/08.pseudo_argu b/checks/08.pseudo_argu
new file mode 100644
index 00000000..8787b016
--- /dev/null
+++ b/checks/08.pseudo_argu
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:1052: Origin of test
+define(`echo', `$@')
+dnl @result{}
+echo(arg1, arg2, arg3 , arg4)
+dnl @result{}arg1,arg2,arg3 ,arg4
diff --git a/checks/09.pseudo_argu b/checks/09.pseudo_argu
new file mode 100644
index 00000000..440d7e7f
--- /dev/null
+++ b/checks/09.pseudo_argu
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:1062: Origin of test
+define(`echo1', `$*')
+dnl @result{}
+define(`echo2', `$@')
+dnl @result{}
+define(`foo', `This is macro `foo'.')
+dnl @result{}
+echo1(foo)
+dnl @result{}This is macro This is macro foo..
+echo2(foo)
+dnl @result{}This is macro foo.
diff --git a/checks/10.pseudo_argu b/checks/10.pseudo_argu
new file mode 100644
index 00000000..1842e3ed
--- /dev/null
+++ b/checks/10.pseudo_argu
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:1082: Origin of test
+define(`foo', `$$$ hello $$$')
+dnl @result{}
+foo
+dnl @result{}$$$ hello $$$
diff --git a/checks/11.pseudo_argu b/checks/11.pseudo_argu
new file mode 100644
index 00000000..dd46c979
--- /dev/null
+++ b/checks/11.pseudo_argu
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:1053: Origin of test
+define(`foo', `$$$ hello $$$')
+dnl @result{}
+foo
+dnl @result{}$$$ hello $$$
diff --git a/checks/11.undefine b/checks/11.undefine
new file mode 100644
index 00000000..9709263d
--- /dev/null
+++ b/checks/11.undefine
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:1113: Origin of test
+foo
+dnl @result{}foo
+define(`foo', `expansion text')
+dnl @result{}
+foo
+dnl @result{}expansion text
+undefine(`foo')
+dnl @result{}
+foo
+dnl @result{}foo
diff --git a/checks/12.defn b/checks/12.defn
new file mode 100644
index 00000000..9ebb42da
--- /dev/null
+++ b/checks/12.defn
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1158: Origin of test
+define(`zap', defn(`undefine'))
+dnl @result{}
+zap(`undefine')
+dnl @result{}
+undefine(`zap')
+dnl @result{}undefine(zap)
diff --git a/checks/12.undefine b/checks/12.undefine
new file mode 100644
index 00000000..1f61131d
--- /dev/null
+++ b/checks/12.undefine
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:1084: Origin of test
+foo
+dnl @result{}foo
+define(`foo', `expansion text')
+dnl @result{}
+foo
+dnl @result{}expansion text
+undefine(`foo')
+dnl @result{}
+foo
+dnl @result{}foo
diff --git a/checks/13.defn b/checks/13.defn
new file mode 100644
index 00000000..1deb3f44
--- /dev/null
+++ b/checks/13.defn
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1128: Origin of test
+define(`zap', defn(`undefine'))
+dnl @result{}
+zap(`undefine')
+dnl @result{}
+undefine(`zap')
+dnl @result{}undefine(zap)
diff --git a/checks/13.pushdef b/checks/13.pushdef
new file mode 100644
index 00000000..bdf078ba
--- /dev/null
+++ b/checks/13.pushdef
@@ -0,0 +1,17 @@
+dnl ../doc/m4.texinfo:1204: Origin of test
+define(`foo', `Expansion one.')
+dnl @result{}
+foo
+dnl @result{}Expansion one.
+pushdef(`foo', `Expansion two.')
+dnl @result{}
+foo
+dnl @result{}Expansion two.
+popdef(`foo')
+dnl @result{}
+foo
+dnl @result{}Expansion one.
+popdef(`foo')
+dnl @result{}
+foo
+dnl @result{}foo
diff --git a/checks/14.defn b/checks/14.defn
new file mode 100644
index 00000000..11ece953
--- /dev/null
+++ b/checks/14.defn
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1148: Origin of test
+define(`string', `The macro dnl is very useful
+')
+dnl @result{}
+string
+dnl @result{}The macro
+defn(`string')
+dnl @result{}The macro dnl is very useful
+dnl @result{}
diff --git a/checks/14.pushdef b/checks/14.pushdef
new file mode 100644
index 00000000..dda7d3fe
--- /dev/null
+++ b/checks/14.pushdef
@@ -0,0 +1,17 @@
+dnl ../doc/m4.texinfo:1228: Origin of test
+define(`foo', `Expansion one.')
+dnl @result{}
+foo
+dnl @result{}Expansion one.
+pushdef(`foo', `Expansion two.')
+dnl @result{}
+foo
+dnl @result{}Expansion two.
+define(`foo', `Second expansion two.')
+dnl @result{}
+foo
+dnl @result{}Second expansion two.
+undefine(`foo')
+dnl @result{}
+foo
+dnl @result{}foo
diff --git a/checks/15.indir b/checks/15.indir
new file mode 100644
index 00000000..881b4deb
--- /dev/null
+++ b/checks/15.indir
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1272: Origin of test
+define(`$$internal$macro', `Internal macro (name `$0')')
+dnl @result{}
+$$internal$macro
+dnl @result{}$$internal$macro
+indir(`$$internal$macro')
+dnl @result{}Internal macro (name $$internal$macro)
diff --git a/checks/15.pushdef b/checks/15.pushdef
new file mode 100644
index 00000000..df2859af
--- /dev/null
+++ b/checks/15.pushdef
@@ -0,0 +1,17 @@
+dnl ../doc/m4.texinfo:1192: Origin of test
+define(`foo', `Expansion one.')
+dnl @result{}
+foo
+dnl @result{}Expansion one.
+pushdef(`foo', `Expansion two.')
+dnl @result{}
+foo
+dnl @result{}Expansion two.
+popdef(`foo')
+dnl @result{}
+foo
+dnl @result{}Expansion one.
+popdef(`foo')
+dnl @result{}
+foo
+dnl @result{}foo
diff --git a/checks/16.ifdef b/checks/16.ifdef
new file mode 100644
index 00000000..c4dec7b5
--- /dev/null
+++ b/checks/16.ifdef
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1343: Origin of test
+ifdef(`foo', ``foo' is defined', ``foo' is not defined')
+dnl @result{}foo is not defined
+define(`foo', `')
+dnl @result{}
+ifdef(`foo', ``foo' is defined', ``foo' is not defined')
+dnl @result{}foo is defined
diff --git a/checks/16.pushdef b/checks/16.pushdef
new file mode 100644
index 00000000..48c0cec6
--- /dev/null
+++ b/checks/16.pushdef
@@ -0,0 +1,17 @@
+dnl ../doc/m4.texinfo:1216: Origin of test
+define(`foo', `Expansion one.')
+dnl @result{}
+foo
+dnl @result{}Expansion one.
+pushdef(`foo', `Expansion two.')
+dnl @result{}
+foo
+dnl @result{}Expansion two.
+define(`foo', `Second expansion two.')
+dnl @result{}
+foo
+dnl @result{}Second expansion two.
+undefine(`foo')
+dnl @result{}
+foo
+dnl @result{}foo
diff --git a/checks/17.ifelse b/checks/17.ifelse
new file mode 100644
index 00000000..836a98f0
--- /dev/null
+++ b/checks/17.ifelse
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1381: Origin of test
+ifelse(foo, bar, `true')
+dnl @result{}
+ifelse(foo, foo, `true')
+dnl @result{}true
+ifelse(foo, bar, `true', `false')
+dnl @result{}false
+ifelse(foo, foo, `true', `false')
+dnl @result{}true
diff --git a/checks/17.indir b/checks/17.indir
new file mode 100644
index 00000000..d573a386
--- /dev/null
+++ b/checks/17.indir
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1267: Origin of test
+define(`$$internal$macro', `Internal macro (name `$0')')
+dnl @result{}
+$$internal$macro
+dnl @result{}$$internal$macro
+indir(`$$internal$macro')
+dnl @result{}Internal macro (name $$internal$macro)
diff --git a/checks/18.ifdef b/checks/18.ifdef
new file mode 100644
index 00000000..40c355ca
--- /dev/null
+++ b/checks/18.ifdef
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1338: Origin of test
+ifdef(`foo', ``foo' is defined', ``foo' is not defined')
+dnl @result{}foo is not defined
+define(`foo', `')
+dnl @result{}
+ifdef(`foo', ``foo' is defined', ``foo' is not defined')
+dnl @result{}foo is defined
diff --git a/checks/18.ifelse b/checks/18.ifelse
new file mode 100644
index 00000000..ddfb7fbb
--- /dev/null
+++ b/checks/18.ifelse
@@ -0,0 +1,3 @@
+dnl ../doc/m4.texinfo:1400: Origin of test
+ifelse(foo, bar, `third', gnu, gnats, `sixth', `seventh')
+dnl @result{}seventh
diff --git a/checks/19.ifelse b/checks/19.ifelse
new file mode 100644
index 00000000..0886f6db
--- /dev/null
+++ b/checks/19.ifelse
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1376: Origin of test
+ifelse(`foo', `bar', `true')
+dnl @result{}
+ifelse(`foo', `foo', `true')
+dnl @result{}true
+ifelse(`foo', `bar', `true', `false')
+dnl @result{}false
+ifelse(`foo', `foo', `true', `false')
+dnl @result{}true
diff --git a/checks/19.loops b/checks/19.loops
new file mode 100644
index 00000000..8ac68eb9
--- /dev/null
+++ b/checks/19.loops
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:1437: Origin of test
+shift(bar)
+dnl @result{}
+shift(foo, bar, baz)
+dnl @result{}bar,baz
diff --git a/checks/20.ifelse b/checks/20.ifelse
new file mode 100644
index 00000000..aff53225
--- /dev/null
+++ b/checks/20.ifelse
@@ -0,0 +1,3 @@
+dnl ../doc/m4.texinfo:1395: Origin of test
+ifelse(foo, bar, `third', gnu, gnats, `sixth', `seventh')
+dnl @result{}seventh
diff --git a/checks/20.loops b/checks/20.loops
new file mode 100644
index 00000000..55dfc86c
--- /dev/null
+++ b/checks/20.loops
@@ -0,0 +1,10 @@
+dnl ../doc/m4.texinfo:1447: Origin of test
+define(`reverse', `ifelse($#, 0, , $#, 1, ``$1'',
+ `reverse(shift($@)), `$1'')')
+dnl @result{}
+reverse
+dnl @result{}
+reverse(foo)
+dnl @result{}foo
+reverse(foo, bar, gnats, and gnus)
+dnl @result{}and gnus, gnats, bar, foo
diff --git a/checks/21.dumpdef b/checks/21.dumpdef
new file mode 100644
index 00000000..689bb786
--- /dev/null
+++ b/checks/21.dumpdef
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1561: Origin of test
+define(`foo', `Hello world.')
+dnl @result{}
+dumpdef(`foo')
+dnl @error{}foo: `Hello world.'
+dnl @result{}
+dumpdef(`define')
+dnl @error{}define: <define>
+dnl @result{}
diff --git a/checks/21.loops b/checks/21.loops
new file mode 100644
index 00000000..2b0290b1
--- /dev/null
+++ b/checks/21.loops
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1432: Origin of test
+shift
+dnl @result{}
+shift(bar)
+dnl @result{}
+shift(foo, bar, baz)
+dnl @result{}bar,baz
diff --git a/checks/22.loops b/checks/22.loops
new file mode 100644
index 00000000..1ecdc076
--- /dev/null
+++ b/checks/22.loops
@@ -0,0 +1,10 @@
+dnl ../doc/m4.texinfo:1444: Origin of test
+define(`reverse', `ifelse($#, 0, , $#, 1, ``$1'',
+ `reverse(shift($@)), `$1'')')
+dnl @result{}
+reverse
+dnl @result{}
+reverse(foo)
+dnl @result{}foo
+reverse(foo, bar, gnats, and gnus)
+dnl @result{}and gnus, gnats, bar, foo
diff --git a/checks/22.trace b/checks/22.trace
new file mode 100644
index 00000000..ae4e639c
--- /dev/null
+++ b/checks/22.trace
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:1606: Origin of test
+define(`foo', `Hello World.')
+dnl @result{}
+define(`echo', `$@')
+dnl @result{}
+traceon(`foo', `echo')
+dnl @result{}
+foo
+dnl @error{}m4trace: -1- foo -> `Hello World.'
+dnl @result{}Hello World.
+echo(gnus, and gnats)
+dnl @error{}m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats''
+dnl @result{}gnus,and gnats
diff --git a/checks/23.dnl b/checks/23.dnl
new file mode 100644
index 00000000..763d9843
--- /dev/null
+++ b/checks/23.dnl
@@ -0,0 +1,4 @@
+dnl ../doc/m4.texinfo:1757: Origin of test
+define(`foo', `Macro `foo'.')dnl A very simple macro, indeed.
+foo
+dnl @result{}Macro foo.
diff --git a/checks/23.dumpdef b/checks/23.dumpdef
new file mode 100644
index 00000000..c65f6934
--- /dev/null
+++ b/checks/23.dumpdef
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1558: Origin of test
+define(`foo', `Hello world.')
+dnl @result{}
+dumpdef(`foo')
+dnl @error{}foo: `Hello world.'
+dnl @result{}
+dumpdef(`define')
+dnl @error{}define: <define>
+dnl @result{}
diff --git a/checks/24.changequote b/checks/24.changequote
new file mode 100644
index 00000000..c74dafdf
--- /dev/null
+++ b/checks/24.changequote
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1795: Origin of test
+changequote([, ])
+dnl @result{}
+define([foo], [Macro [foo].])
+dnl @result{}
+foo
+dnl @result{}Macro foo.
diff --git a/checks/24.trace b/checks/24.trace
new file mode 100644
index 00000000..491eef27
--- /dev/null
+++ b/checks/24.trace
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:1603: Origin of test
+define(`foo', `Hello World.')
+dnl @result{}
+define(`echo', `$@')
+dnl @result{}
+traceon(`foo', `echo')
+dnl @result{}
+foo
+dnl @error{}m4trace: -1- foo -> `Hello World.'
+dnl @result{}Hello World.
+echo(gnus, and gnats)
+dnl @error{}m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats''
+dnl @result{}gnus,and gnats
diff --git a/checks/25.changequote b/checks/25.changequote
new file mode 100644
index 00000000..b3976016
--- /dev/null
+++ b/checks/25.changequote
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1807: Origin of test
+changequote([[, ]])
+dnl @result{}
+define([[foo]], [[Macro [[[foo]]].]])
+dnl @result{}
+foo
+dnl @result{}Macro [foo].
diff --git a/checks/25.dnl b/checks/25.dnl
new file mode 100644
index 00000000..ecdb9b24
--- /dev/null
+++ b/checks/25.dnl
@@ -0,0 +1,4 @@
+dnl ../doc/m4.texinfo:1755: Origin of test
+define(`foo', `Macro `foo'.')dnl A very simple macro, indeed.
+foo
+dnl @result{}Macro foo.
diff --git a/checks/26.changequote b/checks/26.changequote
new file mode 100644
index 00000000..2187982b
--- /dev/null
+++ b/checks/26.changequote
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1819: Origin of test
+define(`foo', `Macro `FOO'.')
+dnl @result{}
+changequote(, )
+dnl @result{}
+foo
+dnl @result{}Macro `FOO'.
+`foo'
+dnl @result{}`Macro `FOO'.'
diff --git a/checks/27.changecom b/checks/27.changecom
new file mode 100644
index 00000000..108cbb59
--- /dev/null
+++ b/checks/27.changecom
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:1859: Origin of test
+define(`comment', `COMMENT')
+dnl @result{}
+# A normal comment
+dnl @result{}# A normal comment
+changecom(`/*', `*/')
+dnl @result{}
+# Not a comment anymore
+dnl @result{}# Not a COMMENT anymore
+But: /* this is a comment now */ while this is not a comment
+dnl @result{}But: /* this is a comment now */ while this is not a COMMENT
diff --git a/checks/27.changequote b/checks/27.changequote
new file mode 100644
index 00000000..bd71cb96
--- /dev/null
+++ b/checks/27.changequote
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1805: Origin of test
+changequote([[, ]])
+dnl @result{}
+define([[foo]], [[Macro [[[foo]]].]])
+dnl @result{}
+foo
+dnl @result{}Macro [foo].
diff --git a/checks/28.changecom b/checks/28.changecom
new file mode 100644
index 00000000..35604dee
--- /dev/null
+++ b/checks/28.changecom
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1880: Origin of test
+define(`comment', `COMMENT')
+dnl @result{}
+changecom
+dnl @result{}
+# Not a comment anymore
+dnl @result{}# Not a COMMENT anymore
diff --git a/checks/28.changequote b/checks/28.changequote
new file mode 100644
index 00000000..ed067f50
--- /dev/null
+++ b/checks/28.changequote
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:1817: Origin of test
+define(`foo', `Macro `FOO'.')
+dnl @result{}
+changequote(, )
+dnl @result{}
+foo
+dnl @result{}Macro `FOO'.
+`foo'
+dnl @result{}`Macro `FOO'.'
diff --git a/checks/29.changecom b/checks/29.changecom
new file mode 100644
index 00000000..7a1dfa60
--- /dev/null
+++ b/checks/29.changecom
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:1857: Origin of test
+define(`comment', `COMMENT')
+dnl @result{}
+# A normal comment
+dnl @result{}# A normal comment
+changecom(`/*', `*/')
+dnl @result{}
+# Not a comment anymore
+dnl @result{}# Not a COMMENT anymore
+But: /* this is a comment now */ while this is not a comment
+dnl @result{}But: /* this is a comment now */ while this is not a COMMENT
diff --git a/checks/29.m4wrap b/checks/29.m4wrap
new file mode 100644
index 00000000..b303c56c
--- /dev/null
+++ b/checks/29.m4wrap
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2019: Origin of test
+define(`cleanup', `This is the `cleanup' actions.
+')
+dnl @result{}
+m4wrap(`cleanup')
+dnl @result{}
+This is the first and last normal input line.
+dnl @result{}This is the first and last normal input line.
+dnl @result{}This is the cleanup actions.
diff --git a/checks/30.changecom b/checks/30.changecom
new file mode 100644
index 00000000..fce2579c
--- /dev/null
+++ b/checks/30.changecom
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:1878: Origin of test
+define(`comment', `COMMENT')
+dnl @result{}
+changecom
+dnl @result{}
+# Not a comment anymore
+dnl @result{}# Not a COMMENT anymore
diff --git a/checks/30.include b/checks/30.include
new file mode 100644
index 00000000..85968c80
--- /dev/null
+++ b/checks/30.include
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:2078: Origin of test
+include(`no-such-file')
+dnl @result{}
+dnl @error{}30.include:2: m4: Cannot open no-such-file: No such file or directory
+sinclude(`no-such-file')
+dnl @result{}
diff --git a/checks/31.changesynta b/checks/31.changesynta
new file mode 100644
index 00000000..02f0ac23
--- /dev/null
+++ b/checks/31.changesynta
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:2023: Origin of test
+define(`test.1', `TEST ONE')
+dnl @result{}
+__file__
+dnl @result{}31.changesynta
+changesyntax(`O_', `W.')
+dnl @result{}
+__file__
+dnl @result{}__file__
+test.1
+dnl @result{}TEST ONE
diff --git a/checks/31.include b/checks/31.include
new file mode 100644
index 00000000..1d3e01bc
--- /dev/null
+++ b/checks/31.include
@@ -0,0 +1,8 @@
+dnl ../doc/m4.texinfo:2098: Origin of test
+define(`foo', `FOO')
+dnl @result{}
+include(`incl.m4')
+dnl @result{}Include file start
+dnl @result{}FOO
+dnl @result{}Include file end
+dnl @result{}
diff --git a/checks/32.changesynta b/checks/32.changesynta
new file mode 100644
index 00000000..8bd2f388
--- /dev/null
+++ b/checks/32.changesynta
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:2039: Origin of test
+define(`test', `$#')
+dnl @result{}
+test(a, b, c)
+dnl @result{}3
+changesyntax(`(<', `,|', `)>', `O(,)')
+dnl @result{}
+test(a, b, c)
+dnl @result{}0(a, b, c)
+test<a|b|c>
+dnl @result{}3
diff --git a/checks/32.include b/checks/32.include
new file mode 100644
index 00000000..ba3208f5
--- /dev/null
+++ b/checks/32.include
@@ -0,0 +1,8 @@
+dnl ../doc/m4.texinfo:2113: Origin of test
+define(`bar', include(`incl.m4'))
+dnl @result{}
+This is `bar': >>>bar<<<
+dnl @result{}This is bar: >>>Include file start
+dnl @result{}foo
+dnl @result{}Include file end
+dnl @result{}<<<
diff --git a/checks/33.changesynta b/checks/33.changesynta
new file mode 100644
index 00000000..e4f76f71
--- /dev/null
+++ b/checks/33.changesynta
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2056: Origin of test
+define(`test', `$1$2$3')
+dnl @result{}
+test(a, b, c)
+dnl @result{}abc
+changesyntax(`O ')
+dnl @result{}
+test(a, b, c)
+dnl @result{}a b c
diff --git a/checks/33.divert b/checks/33.divert
new file mode 100644
index 00000000..1f90fa5f
--- /dev/null
+++ b/checks/33.divert
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2201: Origin of test
+divert(1)
+This text is diverted.
+divert
+dnl @result{}
+This text is not diverted.
+dnl @result{}This text is not diverted.
+dnl @result{}
+dnl @result{}This text is diverted.
diff --git a/checks/34.changesynta b/checks/34.changesynta
new file mode 100644
index 00000000..7b430d69
--- /dev/null
+++ b/checks/34.changesynta
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2075: Origin of test
+define(`@', `TEST')
+dnl @result{}
+@
+dnl @result{}@
+changesyntax(`A@')
+dnl @result{}
+@
+dnl @result{}TEST
diff --git a/checks/34.divert b/checks/34.divert
new file mode 100644
index 00000000..6f0a8a78
--- /dev/null
+++ b/checks/34.divert
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:2221: Origin of test
+divert(-1)
+define(`foo', `Macro `foo'.')
+define(`bar', `Macro `bar'.')
+divert
+dnl @result{}
diff --git a/checks/35.changesynta b/checks/35.changesynta
new file mode 100644
index 00000000..d2ab2d3f
--- /dev/null
+++ b/checks/35.changesynta
@@ -0,0 +1,15 @@
+dnl ../doc/m4.texinfo:2099: Origin of test
+define(`test', `TEST')
+dnl @result{}
+changesyntax(`L<', `R>')
+dnl @result{}
+<test>
+dnl @result{}test
+`test>
+dnl @result{}test
+changequote(<[>, `]')
+dnl @result{}
+<test>
+dnl @result{}<TEST>
+[test]
+dnl @result{}test
diff --git a/checks/35.undivert b/checks/35.undivert
new file mode 100644
index 00000000..a67dce3c
--- /dev/null
+++ b/checks/35.undivert
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:2252: Origin of test
+divert(1)
+This text is diverted.
+divert
+dnl @result{}
+This text is not diverted.
+dnl @result{}This text is not diverted.
+undivert(1)
+dnl @result{}
+dnl @result{}This text is diverted.
+dnl @result{}
diff --git a/checks/36.changesynta b/checks/36.changesynta
new file mode 100644
index 00000000..db3f46f2
--- /dev/null
+++ b/checks/36.changesynta
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2121: Origin of test
+changesyntax(`({<', `)}>', `,;:', `O(,)')
+dnl @result{}
+eval{2**4-1; 2 : 8>
+dnl @result{}00001111
diff --git a/checks/36.undivert b/checks/36.undivert
new file mode 100644
index 00000000..59e2741d
--- /dev/null
+++ b/checks/36.undivert
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:2276: Origin of test
+divert(1)
+This text is diverted first.
+divert(0)undivert(1)dnl
+dnl @result{}
+dnl @result{}This text is diverted first.
+undivert(1)
+dnl @result{}
+divert(1)
+This text is also diverted but not appended.
+divert(0)undivert(1)dnl
+dnl @result{}
+dnl @result{}This text is also diverted but not appended.
diff --git a/checks/37.changesynta b/checks/37.changesynta
new file mode 100644
index 00000000..378d6d51
--- /dev/null
+++ b/checks/37.changesynta
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:2132: Origin of test
+define(`test', `==$1==')
+dnl @result{}
+changequote(`<<', `>>')
+dnl @result{}
+changesyntax(<<L[>>, <<R]>>)
+dnl @result{}
+test(<<testing]>>)
+dnl @result{}==testing]==
+test([testing>>])
+dnl @result{}==testing>>==
+test([<<testing>>])
+dnl @result{}==<<testing>>==
diff --git a/checks/37.undivert b/checks/37.undivert
new file mode 100644
index 00000000..98a11953
--- /dev/null
+++ b/checks/37.undivert
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2302: Origin of test
+define(`bar', `BAR')
+dnl @result{}
+undivert(`foo')
+dnl @result{}bar
+dnl @result{}
+include(`foo')
+dnl @result{}BAR
+dnl @result{}
diff --git a/checks/38.divnum b/checks/38.divnum
new file mode 100644
index 00000000..e56346ee
--- /dev/null
+++ b/checks/38.divnum
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:2328: Origin of test
+Initial divnum
+dnl @result{}Initial 0
+divert(1)
+Diversion one: divnum
+divert(2)
+Diversion two: divnum
+divert
+dnl @result{}
+dnl @result{}
+dnl @result{}Diversion one: 1
+dnl @result{}
+dnl @result{}Diversion two: 2
diff --git a/checks/38.m4wrap b/checks/38.m4wrap
new file mode 100644
index 00000000..95fb12dd
--- /dev/null
+++ b/checks/38.m4wrap
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2293: Origin of test
+define(`cleanup', `This is the `cleanup' actions.
+')
+dnl @result{}
+m4wrap(`cleanup')
+dnl @result{}
+This is the first and last normal input line.
+dnl @result{}This is the first and last normal input line.
+dnl @result{}This is the cleanup actions.
diff --git a/checks/39.cleardiv b/checks/39.cleardiv
new file mode 100644
index 00000000..ab3176b7
--- /dev/null
+++ b/checks/39.cleardiv
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:2359: Origin of test
+divert(1)
+Diversion one: divnum
+divert(2)
+Diversion two: divnum
+divert(-1)
+undivert
diff --git a/checks/39.include b/checks/39.include
new file mode 100644
index 00000000..68cba854
--- /dev/null
+++ b/checks/39.include
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:2352: Origin of test
+include(`no-such-file')
+dnl @result{}
+dnl @error{}39.include:2: m4: Cannot open no-such-file: No such file or directory
+sinclude(`no-such-file')
+dnl @result{}
diff --git a/checks/40.cleardiv b/checks/40.cleardiv
new file mode 100644
index 00000000..9d095038
--- /dev/null
+++ b/checks/40.cleardiv
@@ -0,0 +1,4 @@
+dnl ../doc/m4.texinfo:2374: Origin of test
+define(`cleardivert',
+`pushdef(`_num', divnum)divert(-1)undivert($@)divert(_num)popdef(`_num')')
+dnl @result{}
diff --git a/checks/40.include b/checks/40.include
new file mode 100644
index 00000000..1afae8e2
--- /dev/null
+++ b/checks/40.include
@@ -0,0 +1,8 @@
+dnl ../doc/m4.texinfo:2372: Origin of test
+define(`foo', `FOO')
+dnl @result{}
+include(`incl.m4')
+dnl @result{}Include file start
+dnl @result{}FOO
+dnl @result{}Include file end
+dnl @result{}
diff --git a/checks/41.include b/checks/41.include
new file mode 100644
index 00000000..e5965be9
--- /dev/null
+++ b/checks/41.include
@@ -0,0 +1,8 @@
+dnl ../doc/m4.texinfo:2387: Origin of test
+define(`bar', include(`incl.m4'))
+dnl @result{}
+This is `bar': >>>bar<<<
+dnl @result{}This is bar: >>>Include file start
+dnl @result{}foo
+dnl @result{}Include file end
+dnl @result{}<<<
diff --git a/checks/41.len b/checks/41.len
new file mode 100644
index 00000000..1c64b8e4
--- /dev/null
+++ b/checks/41.len
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2416: Origin of test
+len()
+dnl @result{}0
+len(`abcdef')
+dnl @result{}6
diff --git a/checks/42.divert b/checks/42.divert
new file mode 100644
index 00000000..9c86c5de
--- /dev/null
+++ b/checks/42.divert
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2478: Origin of test
+divert(1)
+This text is diverted.
+divert
+dnl @result{}
+This text is not diverted.
+dnl @result{}This text is not diverted.
+dnl @result{}
+dnl @result{}This text is diverted.
diff --git a/checks/42.index b/checks/42.index
new file mode 100644
index 00000000..bac694f7
--- /dev/null
+++ b/checks/42.index
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2442: Origin of test
+index(`gnus, gnats, and armadillos', `nat')
+dnl @result{}7
+index(`gnus, gnats, and armadillos', `dag')
+dnl @result{}-1
diff --git a/checks/43.divert b/checks/43.divert
new file mode 100644
index 00000000..252fc982
--- /dev/null
+++ b/checks/43.divert
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:2498: Origin of test
+divert(-1)
+define(`foo', `Macro `foo'.')
+define(`bar', `Macro `bar'.')
+divert
+dnl @result{}
diff --git a/checks/43.regexp b/checks/43.regexp
new file mode 100644
index 00000000..3ea5cac3
--- /dev/null
+++ b/checks/43.regexp
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2474: Origin of test
+regexp(`GNUs not Unix', `\<[a-z]\w+')
+dnl @result{}5
+regexp(`GNUs not Unix', `\<Q\w*')
+dnl @result{}-1
diff --git a/checks/44.regexp b/checks/44.regexp
new file mode 100644
index 00000000..8636b787
--- /dev/null
+++ b/checks/44.regexp
@@ -0,0 +1,3 @@
+dnl ../doc/m4.texinfo:2486: Origin of test
+regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***')
+dnl @result{}*** Unix *** nix ***
diff --git a/checks/44.undivert b/checks/44.undivert
new file mode 100644
index 00000000..f99162c6
--- /dev/null
+++ b/checks/44.undivert
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:2529: Origin of test
+divert(1)
+This text is diverted.
+divert
+dnl @result{}
+This text is not diverted.
+dnl @result{}This text is not diverted.
+undivert(1)
+dnl @result{}
+dnl @result{}This text is diverted.
+dnl @result{}
diff --git a/checks/45.substr b/checks/45.substr
new file mode 100644
index 00000000..a60c791b
--- /dev/null
+++ b/checks/45.substr
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2512: Origin of test
+substr(`gnus, gnats, and armadillos', 6)
+dnl @result{}gnats, and armadillos
+substr(`gnus, gnats, and armadillos', 6, 5)
+dnl @result{}gnats
diff --git a/checks/45.undivert b/checks/45.undivert
new file mode 100644
index 00000000..8835f78e
--- /dev/null
+++ b/checks/45.undivert
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:2553: Origin of test
+divert(1)
+This text is diverted first.
+divert(0)undivert(1)dnl
+dnl @result{}
+dnl @result{}This text is diverted first.
+undivert(1)
+dnl @result{}
+divert(1)
+This text is also diverted but not appended.
+divert(0)undivert(1)dnl
+dnl @result{}
+dnl @result{}This text is also diverted but not appended.
diff --git a/checks/46.translit b/checks/46.translit
new file mode 100644
index 00000000..78c10daa
--- /dev/null
+++ b/checks/46.translit
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:2553: Origin of test
+translit(`GNUs not Unix', `A-Z')
+dnl @result{}s not nix
+translit(`GNUs not Unix', `a-z', `A-Z')
+dnl @result{}GNUS NOT UNIX
+translit(`GNUs not Unix', `A-Z', `z-a')
+dnl @result{}tmfs not fnix
diff --git a/checks/46.undivert b/checks/46.undivert
new file mode 100644
index 00000000..f951d011
--- /dev/null
+++ b/checks/46.undivert
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2579: Origin of test
+define(`bar', `BAR')
+dnl @result{}
+undivert(`foo')
+dnl @result{}bar
+dnl @result{}
+include(`foo')
+dnl @result{}BAR
+dnl @result{}
diff --git a/checks/47.divnum b/checks/47.divnum
new file mode 100644
index 00000000..c64945f8
--- /dev/null
+++ b/checks/47.divnum
@@ -0,0 +1,13 @@
+dnl ../doc/m4.texinfo:2605: Origin of test
+Initial divnum
+dnl @result{}Initial 0
+divert(1)
+Diversion one: divnum
+divert(2)
+Diversion two: divnum
+divert
+dnl @result{}
+dnl @result{}
+dnl @result{}Diversion one: 1
+dnl @result{}
+dnl @result{}Diversion two: 2
diff --git a/checks/47.patsubst b/checks/47.patsubst
new file mode 100644
index 00000000..8235b50c
--- /dev/null
+++ b/checks/47.patsubst
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:2604: Origin of test
+patsubst(`GNUs not Unix', `^', `OBS: ')
+dnl @result{}OBS: GNUs not Unix
+patsubst(`GNUs not Unix', `\<', `OBS: ')
+dnl @result{}OBS: GNUs OBS: not OBS: Unix
+patsubst(`GNUs not Unix', `\w*', `(\&)')
+dnl @result{}(GNUs)() (not)() (Unix)
+patsubst(`GNUs not Unix', `\w+', `(\&)')
+dnl @result{}(GNUs) (not) (Unix)
+patsubst(`GNUs not Unix', `[A-Z][a-z]+')
+dnl @result{}GN not
diff --git a/checks/48.cleardiv b/checks/48.cleardiv
new file mode 100644
index 00000000..cd779109
--- /dev/null
+++ b/checks/48.cleardiv
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:2636: Origin of test
+divert(1)
+Diversion one: divnum
+divert(2)
+Diversion two: divnum
+divert(-1)
+undivert
diff --git a/checks/48.patsubst b/checks/48.patsubst
new file mode 100644
index 00000000..0e042a62
--- /dev/null
+++ b/checks/48.patsubst
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2621: Origin of test
+define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl
+define(`downcase', `translit(`$*', `A-Z', `a-z')')dnl
+define(`capitalize1',
+ `regexp(`$1', `^\(\w\)\(\w*\)', `upcase(`\1')`'downcase(`\2')')')dnl
+define(`capitalize',
+ `patsubst(`$1', `\w+', `capitalize1(`\&')')')dnl
+capitalize(`GNUs not Unix')
+dnl @result{}Gnus Not Unix
diff --git a/checks/49.cleardiv b/checks/49.cleardiv
new file mode 100644
index 00000000..8d4b7501
--- /dev/null
+++ b/checks/49.cleardiv
@@ -0,0 +1,4 @@
+dnl ../doc/m4.texinfo:2651: Origin of test
+define(`cleardivert',
+`pushdef(`_num', divnum)divert(-1)undivert($@)divert(_num)popdef(`_num')')
+dnl @result{}
diff --git a/checks/49.format b/checks/49.format
new file mode 100644
index 00000000..0daa49a7
--- /dev/null
+++ b/checks/49.format
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2656: Origin of test
+define(`foo', `The brown fox jumped over the lazy dog')
+dnl @result{}
+format(`The string "%s" is %d characters long', foo, len(foo))
+dnl @result{}The string "The brown fox jumped over the lazy dog" is 38 characters long
diff --git a/checks/50.incr b/checks/50.incr
new file mode 100644
index 00000000..45ee7226
--- /dev/null
+++ b/checks/50.incr
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2726: Origin of test
+incr(4)
+dnl @result{}5
+decr(7)
+dnl @result{}6
diff --git a/checks/50.len b/checks/50.len
new file mode 100644
index 00000000..37c7cf72
--- /dev/null
+++ b/checks/50.len
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2693: Origin of test
+len()
+dnl @result{}0
+len(`abcdef')
+dnl @result{}6
diff --git a/checks/51.eval b/checks/51.eval
new file mode 100644
index 00000000..dcf04759
--- /dev/null
+++ b/checks/51.eval
@@ -0,0 +1,18 @@
+dnl ../doc/m4.texinfo:2808: Origin of test
+eval(-3 * 5)
+dnl @result{}-15
+eval(index(`Hello world', `llo') >= 0)
+dnl @result{}1
+define(`square', `eval(($1)**2)')
+dnl @result{}
+square(9)
+dnl @result{}81
+square(square(5)+1)
+dnl @result{}676
+define(`foo', `666')
+dnl @result{}
+eval(`foo'/6)
+dnl @error{}51.eval:14: m4: Bad expression in eval: foo/6
+dnl @result{}
+eval(foo/6)
+dnl @result{}111
diff --git a/checks/51.index b/checks/51.index
new file mode 100644
index 00000000..e540cdd8
--- /dev/null
+++ b/checks/51.index
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2719: Origin of test
+index(`gnus, gnats, and armadillos', `nat')
+dnl @result{}7
+index(`gnus, gnats, and armadillos', `dag')
+dnl @result{}-1
diff --git a/checks/52.eval b/checks/52.eval
new file mode 100644
index 00000000..b6a0da83
--- /dev/null
+++ b/checks/52.eval
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:2839: Origin of test
+eval(666, 10)
+dnl @result{}666
+eval(666, 11)
+dnl @result{}556
+eval(666, 6)
+dnl @result{}3030
+eval(666, 6, 10)
+dnl @result{}0000003030
+eval(-666, 6, 10)
+dnl @result{}-000003030
diff --git a/checks/52.regexp b/checks/52.regexp
new file mode 100644
index 00000000..27ad63d5
--- /dev/null
+++ b/checks/52.regexp
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2751: Origin of test
+regexp(`GNUs not Unix', `\<[a-z]\w+')
+dnl @result{}5
+regexp(`GNUs not Unix', `\<Q\w*')
+dnl @result{}-1
diff --git a/checks/53.esyscmd b/checks/53.esyscmd
new file mode 100644
index 00000000..c92f7941
--- /dev/null
+++ b/checks/53.esyscmd
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:2924: Origin of test
+define(`vice', `esyscmd(grep Vice ../COPYING)')
+dnl @result{}
+vice
+dnl @result{} Ty Coon, President of Vice
+dnl @result{}
diff --git a/checks/53.regexp b/checks/53.regexp
new file mode 100644
index 00000000..b9263838
--- /dev/null
+++ b/checks/53.regexp
@@ -0,0 +1,3 @@
+dnl ../doc/m4.texinfo:2763: Origin of test
+regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***')
+dnl @result{}*** Unix *** nix ***
diff --git a/checks/54.substr b/checks/54.substr
new file mode 100644
index 00000000..b2ad41ff
--- /dev/null
+++ b/checks/54.substr
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2789: Origin of test
+substr(`gnus, gnats, and armadillos', 6)
+dnl @result{}gnats, and armadillos
+substr(`gnus, gnats, and armadillos', 6, 5)
+dnl @result{}gnats
diff --git a/checks/54.sysval b/checks/54.sysval
new file mode 100644
index 00000000..bc9400db
--- /dev/null
+++ b/checks/54.sysval
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2955: Origin of test
+syscmd(`false')
+dnl @result{}
+ifelse(sysval, 0, zero, non-zero)
+dnl @result{}non-zero
+syscmd(`true')
+dnl @result{}
+sysval
+dnl @result{}0
diff --git a/checks/55.errprint b/checks/55.errprint
new file mode 100644
index 00000000..ba292c22
--- /dev/null
+++ b/checks/55.errprint
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:3034: Origin of test
+errprint(`Illegal arguments to forloop
+')
+dnl @error{}Illegal arguments to forloop
+dnl @result{}
diff --git a/checks/55.translit b/checks/55.translit
new file mode 100644
index 00000000..d0c1a522
--- /dev/null
+++ b/checks/55.translit
@@ -0,0 +1,7 @@
+dnl ../doc/m4.texinfo:2830: Origin of test
+translit(`GNUs not Unix', `A-Z')
+dnl @result{}s not nix
+translit(`GNUs not Unix', `a-z', `A-Z')
+dnl @result{}GNUS NOT UNIX
+translit(`GNUs not Unix', `A-Z', `z-a')
+dnl @result{}tmfs not fnix
diff --git a/checks/56.errprint b/checks/56.errprint
new file mode 100644
index 00000000..a5be31ff
--- /dev/null
+++ b/checks/56.errprint
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:3059: Origin of test
+errprint(`m4:'__file__:__line__: `Input error
+')
+dnl @error{}m4:56.errprint:2: Input error
+dnl @result{}
diff --git a/checks/56.patsubst b/checks/56.patsubst
new file mode 100644
index 00000000..5da8e3c7
--- /dev/null
+++ b/checks/56.patsubst
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:2881: Origin of test
+patsubst(`GNUs not Unix', `^', `OBS: ')
+dnl @result{}OBS: GNUs not Unix
+patsubst(`GNUs not Unix', `\<', `OBS: ')
+dnl @result{}OBS: GNUs OBS: not OBS: Unix
+patsubst(`GNUs not Unix', `\w*', `(\&)')
+dnl @result{}(GNUs)() (not)() (Unix)
+patsubst(`GNUs not Unix', `\w+', `(\&)')
+dnl @result{}(GNUs) (not) (Unix)
+patsubst(`GNUs not Unix', `[A-Z][a-z]+')
+dnl @result{}GN not
diff --git a/checks/57.m4exit b/checks/57.m4exit
new file mode 100644
index 00000000..2cbb2d18
--- /dev/null
+++ b/checks/57.m4exit
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:3082: Origin of test
+define(`fatal_error', `errprint(`m4: '__file__: __line__`: fatal error: $*
+')m4exit(1)')
+dnl @result{}
+fatal_error(`This is a BAD one, buster')
+dnl @error{}m4: 57.m4exit: 5: fatal error: This is a BAD one, buster
diff --git a/checks/57.patsubst b/checks/57.patsubst
new file mode 100644
index 00000000..36f0f315
--- /dev/null
+++ b/checks/57.patsubst
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:2898: Origin of test
+define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl
+define(`downcase', `translit(`$*', `A-Z', `a-z')')dnl
+define(`capitalize1',
+ `regexp(`$1', `^\(\w\)\(\w*\)', `upcase(`\1')`'downcase(`\2')')')dnl
+define(`capitalize',
+ `patsubst(`$1', `\w+', `capitalize1(`\&')')')dnl
+capitalize(`GNUs not Unix')
+dnl @result{}Gnus Not Unix
diff --git a/checks/58.format b/checks/58.format
new file mode 100644
index 00000000..edeefd7e
--- /dev/null
+++ b/checks/58.format
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:2933: Origin of test
+define(`foo', `The brown fox jumped over the lazy dog')
+dnl @result{}
+format(`The string "%s" is %d characters long', foo, len(foo))
+dnl @result{}The string "The brown fox jumped over the lazy dog" is 38 characters long
diff --git a/checks/59.incr b/checks/59.incr
new file mode 100644
index 00000000..a6c4f6f2
--- /dev/null
+++ b/checks/59.incr
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:3003: Origin of test
+incr(4)
+dnl @result{}5
+decr(7)
+dnl @result{}6
diff --git a/checks/60.eval b/checks/60.eval
new file mode 100644
index 00000000..89490b2e
--- /dev/null
+++ b/checks/60.eval
@@ -0,0 +1,18 @@
+dnl ../doc/m4.texinfo:3097: Origin of test
+eval(-3 * 5)
+dnl @result{}-15
+eval(index(`Hello world', `llo') >= 0)
+dnl @result{}1
+define(`square', `eval(($1)**2)')
+dnl @result{}
+square(9)
+dnl @result{}81
+square(square(5)+1)
+dnl @result{}676
+define(`foo', `666')
+dnl @result{}
+eval(`foo'/6)
+dnl @error{}60.eval:14: m4: Bad expression in eval: foo/6
+dnl @result{}
+eval(foo/6)
+dnl @result{}111
diff --git a/checks/61.eval b/checks/61.eval
new file mode 100644
index 00000000..64594c57
--- /dev/null
+++ b/checks/61.eval
@@ -0,0 +1,11 @@
+dnl ../doc/m4.texinfo:3128: Origin of test
+eval(666, 10)
+dnl @result{}666
+eval(666, 11)
+dnl @result{}556
+eval(666, 6)
+dnl @result{}3030
+eval(666, 6, 10)
+dnl @result{}0000003030
+eval(-666, 6, 10)
+dnl @result{}-000003030
diff --git a/checks/62.esyscmd b/checks/62.esyscmd
new file mode 100644
index 00000000..27c3bda4
--- /dev/null
+++ b/checks/62.esyscmd
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:3213: Origin of test
+define(`vice', `esyscmd(grep Vice ../COPYING)')
+dnl @result{}
+vice
+dnl @result{} Ty Coon, President of Vice
+dnl @result{}
diff --git a/checks/63.sysval b/checks/63.sysval
new file mode 100644
index 00000000..1b7b110a
--- /dev/null
+++ b/checks/63.sysval
@@ -0,0 +1,9 @@
+dnl ../doc/m4.texinfo:3244: Origin of test
+syscmd(`false')
+dnl @result{}
+ifelse(sysval, 0, zero, non-zero)
+dnl @result{}non-zero
+syscmd(`true')
+dnl @result{}
+sysval
+dnl @result{}0
diff --git a/checks/64.errprint b/checks/64.errprint
new file mode 100644
index 00000000..b0cfbffd
--- /dev/null
+++ b/checks/64.errprint
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:3324: Origin of test
+errprint(`Illegal arguments to forloop
+')
+dnl @error{}Illegal arguments to forloop
+dnl @result{}
diff --git a/checks/65.errprint b/checks/65.errprint
new file mode 100644
index 00000000..230093e8
--- /dev/null
+++ b/checks/65.errprint
@@ -0,0 +1,5 @@
+dnl ../doc/m4.texinfo:3349: Origin of test
+errprint(`m4:'__file__:__line__: `Input error
+')
+dnl @error{}m4:65.errprint:2: Input error
+dnl @result{}
diff --git a/checks/66.m4exit b/checks/66.m4exit
new file mode 100644
index 00000000..eccef14b
--- /dev/null
+++ b/checks/66.m4exit
@@ -0,0 +1,6 @@
+dnl ../doc/m4.texinfo:3372: Origin of test
+define(`fatal_error', `errprint(`m4: '__file__: __line__`: fatal error: $*
+')m4exit(1)')
+dnl @result{}
+fatal_error(`This is a BAD one, buster')
+dnl @error{}m4: 66.m4exit: 5: fatal error: This is a BAD one, buster
diff --git a/checks/Makefile.am b/checks/Makefile.am
new file mode 100644
index 00000000..65d0de77
--- /dev/null
+++ b/checks/Makefile.am
@@ -0,0 +1,16 @@
+EXTRA_DIST = check-them foo get-them incl.m4 stamp-checks $(CHECKS)
+
+CHECKS = ??.*
+
+all: stamp-checks
+
+stamp-checks: get-them ../doc/m4.texinfo
+ rm -f $(srcdir)/$(CHECKS)
+ cd $(srcdir) && AWK=$(AWK) ./get-them ../doc/m4.texinfo
+ touch $(srcdir)/stamp-checks
+
+check: stamp-checks
+ PATH=`pwd`/../src:$$PATH; export PATH; \
+ cd $(srcdir) && ./check-them $(CHECKS)
+
+
diff --git a/checks/Makefile.in b/checks/Makefile.in
new file mode 100644
index 00000000..c1c4aaf8
--- /dev/null
+++ b/checks/Makefile.in
@@ -0,0 +1,76 @@
+# Makefile for GNU m4 checks directory.
+# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+PRODUCT = @PRODUCT@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+# Should be GNU awk, for the get-them script.
+AWK = @AWK@
+
+# Vern says that the first star is required around an Alpha make bug.
+CHECKS = *[0-9][0-9].*
+DISTFILES = Makefile.in get-them check-them stamp-checks incl.m4 foo
+
+all: stamp-checks
+
+stamp-checks: get-them ../doc/m4.texinfo
+ rm -f $(srcdir)/$(CHECKS)
+ cd $(srcdir) && AWK=$(AWK) ./get-them ../doc/m4.texinfo
+ touch $(srcdir)/stamp-checks
+
+install:
+
+uninstall:
+
+check: stamp-checks
+ PATH=`pwd`/../src:$$PATH; export PATH; \
+ cd $(srcdir) && ./check-them $(CHECKS)
+
+tags:
+
+mostlyclean:
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile
+
+realclean: distclean
+ rm -f $(CHECKS) stamp-checks
+
+dist: $(DISTFILES)
+ @echo "Copying distribution files"
+ @for file in $(DISTFILES); do \
+ ln $(srcdir)/$$file ../$(PRODUCT)-$(VERSION)/checks 2> /dev/null \
+ || cp -p $(srcdir)/$$file ../$(PRODUCT)-$(VERSION)/checks; \
+ done
+ @for file in $(srcdir)/$(CHECKS); do \
+ ln $$file ../$(PRODUCT)-$(VERSION)/checks \
+ || cp -p $$file ../$(PRODUCT)-$(VERSION)/checks; \
+ done
+
+Makefile: Makefile.in ../config.status
+ cd .. && CONFIG_FILES=checks/$@ CONFIG_HEADERS= ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/checks/check-them b/checks/check-them
new file mode 100755
index 00000000..5dd205b9
--- /dev/null
+++ b/checks/check-them
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Check GNU m4 against examples from the manual source.
+# Copyright (C) 1992 Free Software Foundation, Inc.
+
+out=/tmp/m4-out.$$
+err=/tmp/m4-err.$$
+xout=/tmp/m4-xout.$$
+xerr=/tmp/m4-xerr.$$
+
+trap "rm -f $out $err $xout $xerr; exit 1" 1 2 15
+
+m4 --version
+
+for file
+do
+ echo "Checking $file"
+ m4 -d $file >$out 2>$err
+
+ sed -e '/^dnl @result{}/!d' -e 's///' $file > $xout
+
+ if cmp -s $out $xout; then
+ :
+ else
+ failed="$failed $file:out"
+ echo `sed -e 's/^dnl //' -e 1q $file`
+ echo "$file: stdout mismatch"
+ diff $xout $out
+ fi
+
+ sed -e '/^dnl @error{}/!d' -e 's///' $file > $xerr
+
+ if cmp -s $err $xerr; then
+ :
+ else
+ failed="$failed $file:err"
+ echo `sed -e 's/^dnl //' -e 1q $file`
+ echo "$file: stderr mismatch"
+ diff $xerr $err
+ fi
+
+done
+
+rm -f $out $err $xout $xerr
+
+echo
+if test -z "$failed"; then
+ echo "All checks successful"
+else
+ echo "Failed checks were:"
+ echo " $failed"
+fi
diff --git a/checks/foo b/checks/foo
new file mode 100644
index 00000000..5716ca59
--- /dev/null
+++ b/checks/foo
@@ -0,0 +1 @@
+bar
diff --git a/checks/get-them b/checks/get-them
new file mode 100755
index 00000000..84300f02
--- /dev/null
+++ b/checks/get-them
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Extract all examples from the manual source.
+# Copyright (C) 1992 Free Software Foundation, Inc.
+
+# This script is for use with GNU awk.
+
+FILE=${1-/dev/null}
+
+$AWK '
+
+BEGIN {
+ node = "";
+ seq = -1;
+ count = 0;
+ file = "NONE";
+}
+
+/^@node / {
+ if (seq > 0)
+ printf(" -- %d file%s", seq, seq == 1 ? "" : "s");
+ if (seq >= 0)
+ printf("\n");
+
+ split($0, tmp, ",");
+ node = substr(tmp[1], 7);
+ if (length(node) > 11)
+ printf("Node: %s - truncated", node);
+ else
+ printf("Node: %s ", node);
+ gsub(" ", "_", node);
+ node = tolower(substr(node, 1, 11));
+ seq = 0;
+}
+
+/^@comment ignore$/ {
+ getline;
+ next;
+}
+
+/^@example$/, /^@end example$/ {
+ if (seq < 0)
+ next;
+ if ($0 ~ /^@example$/) {
+ if (count > 0)
+ close (file);
+ seq++;
+ count++;
+ file = sprintf("%02d.%s", count, node);
+ printf("dnl %s:%d: Origin of test\n", FILENAME, NR) > file;
+ next;
+ }
+ if ($0 ~ /^@end example$/) {
+ next;
+ }
+ if ($0 ~ /^\^D$/)
+ next;
+ if ($0 ~ /^@result\{\}/ || $0 ~ /^@error\{\}/)
+ prefix = "dnl ";
+ else
+ prefix = "";
+ gsub("@@", "@", $0);
+ printf("%s%s\n", prefix, $0) >> file;
+}
+
+END {
+ printf("\n");
+}
+' $FILE
diff --git a/checks/incl.m4 b/checks/incl.m4
new file mode 100644
index 00000000..ab9572eb
--- /dev/null
+++ b/checks/incl.m4
@@ -0,0 +1,3 @@
+Include file start
+foo
+Include file end
diff --git a/checks/stamp-checks b/checks/stamp-checks
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/checks/stamp-checks