diff --git a/tools/regression/usr.bin/make/syntax/enl/Makefile b/tools/regression/usr.bin/make/syntax/enl/Makefile new file mode 100644 index 000000000000..7b37e78e8226 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/Makefile @@ -0,0 +1,25 @@ +# $FreeBSD$ +# +# Test handling of escaped newlines. +# + +.ifmake test1 + +# This should succeed +\ +\ +\ +test1: + @echo ok + +.elifmake test2 + +# This should fail because the comment continues on the next lines leading +# to an unassociated shell command. +\ +#\ +\ +test2: + @echo ok + +.endif diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.1 b/tools/regression/usr.bin/make/syntax/enl/expected.status.1 new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.2 b/tools/regression/usr.bin/make/syntax/enl/expected.status.2 new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.2 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.1 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.1 new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 new file mode 100644 index 000000000000..ae504f95c3f9 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 @@ -0,0 +1,2 @@ +"Makefile", line 23: Unassociated shell command "@echo ok" +make: fatal errors encountered -- cannot continue diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.1 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.1 new file mode 100644 index 000000000000..9766475a4185 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.1 @@ -0,0 +1 @@ +ok diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/regression/usr.bin/make/syntax/enl/test.t b/tools/regression/usr.bin/make/syntax/enl/test.t new file mode 100644 index 000000000000..de8bcfebccef --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/test.t @@ -0,0 +1,15 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="Test escaped new-lines handling." + +# Run +TEST_N=2 +TEST_2_TODO="bug in parser" + +eval_cmd $*