summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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