aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-05-14 03:32:40 +0000
committerBruce Momjian <bruce@momjian.us>1997-05-14 03:32:40 +0000
commitd906936e0e18e59ab469e2c5e8d17a16f4b4ed76 (patch)
tree5e677fb012c00148b5af00199708828b39c7f500
parent650638c43f9c3afbfe31dab7e524ee6bafd080a5 (diff)
downloadpostgresql-d906936e0e18e59ab469e2c5e8d17a16f4b4ed76.tar.gz
postgresql-d906936e0e18e59ab469e2c5e8d17a16f4b4ed76.zip
Add test for flex bug as part of make, and point them to README.flex.
-rw-r--r--src/GNUmakefile.in3
-rw-r--r--src/lextest/Makefile13
-rw-r--r--src/lextest/lextest.c10
-rw-r--r--src/lextest/scan.l10
4 files changed, 35 insertions, 1 deletions
diff --git a/src/GNUmakefile.in b/src/GNUmakefile.in
index 5a25488a4e0..d34beb9fbd6 100644
--- a/src/GNUmakefile.in
+++ b/src/GNUmakefile.in
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.12 1997/04/15 18:17:43 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.13 1997/05/14 03:32:16 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -30,6 +30,7 @@ all:
false ;\
else true;\
fi
+ $(MAKE) -C lextest all
$(MAKE) -C utils all
$(MAKE) -C backend all
$(MAKE) -C libpq all
diff --git a/src/lextest/Makefile b/src/lextest/Makefile
new file mode 100644
index 00000000000..efbc20d34a5
--- /dev/null
+++ b/src/lextest/Makefile
@@ -0,0 +1,13 @@
+#
+# Makefile - tests for 2.5.3 flex bug
+#
+#
+lextest : lextest.c scan.l
+ $(LEX) scan.l
+ $(CC) -c lex.yy.c
+ $(CC) -c lextest.c
+ $(CC) -o lextest lex.yy.o lextest.o
+ @echo "If this fails, flex is broken" | lextest || echo "You have a buggy version of flex. Read doc/README.flex for a fix."
+
+clean:
+ rm -f lextest lex.yy.c lex.yy.o lextest.o
diff --git a/src/lextest/lextest.c b/src/lextest/lextest.c
new file mode 100644
index 00000000000..e8089f2949b
--- /dev/null
+++ b/src/lextest/lextest.c
@@ -0,0 +1,10 @@
+main()
+{
+ yylex();
+ return;
+}
+
+yywrap()
+{
+ return 1;
+};
diff --git a/src/lextest/scan.l b/src/lextest/scan.l
new file mode 100644
index 00000000000..6f801376a33
--- /dev/null
+++ b/src/lextest/scan.l
@@ -0,0 +1,10 @@
+/*
+ This should work, but non-patched flex 2.5.3 fails because input()
+ doesn't return EOF
+ Bruce Momjian <root@candle.pha.pa.us>
+*/
+%%
+. {
+ while (input() != EOF)
+ ;
+ }