summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-04-12 16:58:16 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-04-12 16:58:16 +0000
commitb62a38f7a63f839572d350e11cddb5eb541227a7 (patch)
treeb8f2197aa0917b955dc157d4630c5cf08dd9adfe
parent3131900f2373d5300104e48f6e3559370d98004a (diff)
regress tests for moe gm4 compat
-rw-r--r--regress/usr.bin/m4/Makefile12
-rw-r--r--regress/usr.bin/m4/gnueval.m46
-rw-r--r--regress/usr.bin/m4/gnueval.out3
-rw-r--r--regress/usr.bin/m4/gnusofterror.m43
-rw-r--r--regress/usr.bin/m4/gnusofterror.out1
5 files changed, 23 insertions, 2 deletions
diff --git a/regress/usr.bin/m4/Makefile b/regress/usr.bin/m4/Makefile
index e001ba483ae..59170bc0a88 100644
--- a/regress/usr.bin/m4/Makefile
+++ b/regress/usr.bin/m4/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.29 2011/03/24 11:28:19 espie Exp $
+# $OpenBSD: Makefile,v 1.30 2012/04/12 16:58:15 espie Exp $
FIBOMAX=25
M4=m4
@@ -12,7 +12,8 @@ REGRESS_TARGETS= test-ff_after_dnl test-m4wrap test-m4wrap2 \
test-weird test-args test-args2 test-esyscmd test-eval test-gnupatterns \
test-gnupatterns2 test-comments test-synch1 test-synch1bis \
test-gnuformat test-includes test-dumpdef test-gnuprefix \
- test-translit test-translit2 test-gnutranslit2
+ test-translit test-translit2 test-gnutranslit2 \
+ test-gnueval test-gnusofterror
test-ff_after_dnl: ff_after_dnl.m4
${M4} ff_after_dnl.m4 | diff - ${.CURDIR}/ff_after_dnl.out
@@ -109,6 +110,13 @@ test-translit2:
test-gnutranslit2:
${M4} -g ${.CURDIR}/translit2.m4 | diff -u - ${.CURDIR}/gnutranslit2.out
+test-gnueval:
+ ${M4} -g ${.CURDIR}/gnueval.m4 | diff -u - ${.CURDIR}/gnueval.out
+
+test-gnusofterror:
+ ${M4} -g ${.CURDIR}/gnusofterror.m4 2>/dev/null| diff -u - ${.CURDIR}/gnusofterror.out
+ ! ${M4} -g ${.CURDIR}/gnusofterror.m4 2>/dev/null >/dev/null
+
.PHONY: ${REGRESS_TARGETS}
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/m4/gnueval.m4 b/regress/usr.bin/m4/gnueval.m4
new file mode 100644
index 00000000000..3c6944f886a
--- /dev/null
+++ b/regress/usr.bin/m4/gnueval.m4
@@ -0,0 +1,6 @@
+dnl $OpenBSD: gnueval.m4,v 1.1 2012/04/12 16:58:15 espie Exp $
+dnl exponentiation is right associative
+eval(`4**2**3')
+dnl priority between unary operators and *
+eval(`4**2*3')
+eval(`-4**3')
diff --git a/regress/usr.bin/m4/gnueval.out b/regress/usr.bin/m4/gnueval.out
new file mode 100644
index 00000000000..6d7fd49ca21
--- /dev/null
+++ b/regress/usr.bin/m4/gnueval.out
@@ -0,0 +1,3 @@
+65536
+48
+-64
diff --git a/regress/usr.bin/m4/gnusofterror.m4 b/regress/usr.bin/m4/gnusofterror.m4
new file mode 100644
index 00000000000..07e43b6fcdf
--- /dev/null
+++ b/regress/usr.bin/m4/gnusofterror.m4
@@ -0,0 +1,3 @@
+dnl $OpenBSD: gnusofterror.m4,v 1.1 2012/04/12 16:58:15 espie Exp $
+include(`hey I do not exit')dnl
+abc
diff --git a/regress/usr.bin/m4/gnusofterror.out b/regress/usr.bin/m4/gnusofterror.out
new file mode 100644
index 00000000000..8baef1b4abc
--- /dev/null
+++ b/regress/usr.bin/m4/gnusofterror.out
@@ -0,0 +1 @@
+abc