From deaa8feaff48aad6c5c14dfefa784f5990326b6c Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 1 Jul 2000 00:49:09 +0000 Subject: Add vicious Fibonacci test. Our m4 runs against a hard limit pretty soon currently, but this will be fixed. --- regress/usr.bin/m4/Makefile | 9 +++++++-- regress/usr.bin/m4/fibo.m4 | 7 +++++++ regress/usr.bin/m4/fibo.out | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 regress/usr.bin/m4/fibo.m4 create mode 100644 regress/usr.bin/m4/fibo.out (limited to 'regress') diff --git a/regress/usr.bin/m4/Makefile b/regress/usr.bin/m4/Makefile index 345c5ed3def..a3742b22cf4 100644 --- a/regress/usr.bin/m4/Makefile +++ b/regress/usr.bin/m4/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.1 2000/07/01 00:31:01 espie Exp $ +# $OpenBSD: Makefile,v 1.2 2000/07/01 00:49:07 espie Exp $ # $NetBSD: Makefile,v 1.2 1999/02/13 02:54:33 lukem Exp $ NOMAN= @@ -6,7 +6,7 @@ NOPROG= CLEANFILES+= ff_after_dnl.m4 -regress: test-ff_after_dnl test-m4wrap +regress: test-ff_after_dnl test-m4wrap test-fibo test-ff_after_dnl: ff_after_dnl.m4 m4 ff_after_dnl.m4 | diff - ${.CURDIR}/ff_after_dnl.out @@ -17,4 +17,9 @@ ff_after_dnl.m4: ff_after_dnl.m4.uu test-m4wrap: m4 ${.CURDIR}/m4wrap.m4 | diff - ${.CURDIR}/m4wrap.out +test-fibo: + m4 ${.CURDIR}/fibo.m4 | diff - ${.CURDIR}/fibo.out + +.PHONY: test-ff_after_dnl test-m4wrap test-fibo + .include diff --git a/regress/usr.bin/m4/fibo.m4 b/regress/usr.bin/m4/fibo.m4 new file mode 100644 index 00000000000..36d719a251c --- /dev/null +++ b/regress/usr.bin/m4/fibo.m4 @@ -0,0 +1,7 @@ +dnl $OpenBSD: fibo.m4,v 1.1 2000/07/01 00:49:07 espie Exp $ +define(`copy', `$1')dnl +define(`fibo',dnl +`ifelse($1,0,`a',dnl +$1,1,`b',dnl +`copy(fibo(decr($1)))`'copy(fibo(decr(decr($1))))')')dnl +fibo(13) diff --git a/regress/usr.bin/m4/fibo.out b/regress/usr.bin/m4/fibo.out new file mode 100644 index 00000000000..2c7ada13967 --- /dev/null +++ b/regress/usr.bin/m4/fibo.out @@ -0,0 +1 @@ +babbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabab -- cgit v1.2.3