summaryrefslogtreecommitdiff
path: root/tests/scripts/misc/bs-nl
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@golden-gryphon.com>2016-08-01 01:09:02 -0700
committerManoj Srivastava <srivasta@golden-gryphon.com>2016-08-01 01:09:02 -0700
commitcae4fe5df01ef0e0f4977c15085bb6df16d70f3a (patch)
tree7c37550107df32bfd25ef4ba594f2bf017bb226b /tests/scripts/misc/bs-nl
parent38ebe83c5bc047a1f5c1c8f9734d0303f22603f8 (diff)
parent9ab8af7cd8aaac587787d9df7e34758951d7c470 (diff)
Merge tag '4.2.1' into upstream
GNU Make release 4.2.1 Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com> # gpg: Signature made Fri 10 Jun 2016 04:30:54 PM PDT # gpg: using DSA key 96B047156338B6D4 # gpg: Good signature from "Paul Smith (Mad Scientist) <psmith@gnu.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 3D25 54F0 A153 38AB 9AF1 BB9D 96B0 4715 6338 B6D4 # Conflicts: # AUTHORS # Makefile.am # Makefile.ami # NEWS # README.Amiga # README.VMS # README.customs # acinclude.m4 # amiga.c # amiga.h # ar.c # arscan.c # build_w32.bat # commands.c # commands.h # config/Makefile.am # config/dospaths.m4 # configure.ac # configure.bat # debug.h # default.c # dep.h # dir.c # doc/Makefile.am # doc/make.texi # dosbuild.bat # expand.c # file.c # filedef.h # function.c # getloadavg.c # getopt.c # getopt.h # getopt1.c # gettext.h # gmk-default.scm # gnumake.h # guile.c # implicit.c # job.c # job.h # load.c # loadapi.c # main.c # make.1 # make_msvc_net2003.vcproj # makefile.com # makefile.vms # makeint.h # misc.c # output.c # output.h # po/Makevars # po/POTFILES.in # read.c # remake.c # remote-cstms.c # remote-stub.c # rule.c # rule.h # signame.c # strcache.c # subproc.bat # tests/ChangeLog.1 # tests/NEWS # tests/README # tests/config_flags_pm.com # tests/mkshadow # tests/run_make_tests.com # tests/run_make_tests.pl # tests/scripts/features/archives # tests/scripts/features/conditionals # tests/scripts/features/double_colon # tests/scripts/features/errors # tests/scripts/features/include # tests/scripts/features/jobserver # tests/scripts/features/load # tests/scripts/features/output-sync # tests/scripts/features/parallelism # tests/scripts/features/patternrules # tests/scripts/features/vpath3 # tests/scripts/features/vpathplus # tests/scripts/functions/call # tests/scripts/functions/error # tests/scripts/functions/file # tests/scripts/functions/foreach # tests/scripts/functions/shell # tests/scripts/functions/sort # tests/scripts/functions/warning # tests/scripts/misc/bs-nl # tests/scripts/misc/fopen-fail # tests/scripts/misc/general3 # tests/scripts/options/dash-B # tests/scripts/options/dash-W # tests/scripts/options/dash-k # tests/scripts/options/dash-n # tests/scripts/options/dash-q # tests/scripts/options/print-directory # tests/scripts/targets/POSIX # tests/scripts/variables/MAKEFLAGS # tests/scripts/variables/MAKE_RESTARTS # tests/scripts/variables/SHELL # tests/scripts/variables/special # tests/test_driver.pl # variable.c # variable.h # version.c # vmsdir.h # vmsfunctions.c # vmsify.c # vmsjobs.c # vpath.c # w32/Makefile.am # w32/compat/dirent.c # w32/compat/posixfcn.c # w32/include/dirent.h # w32/include/dlfcn.h # w32/include/pathstuff.h # w32/include/sub_proc.h # w32/include/w32err.h # w32/pathstuff.c # w32/subproc/NMakefile # w32/subproc/misc.c # w32/subproc/proc.h # w32/subproc/sub_proc.c # w32/subproc/w32err.c
Diffstat (limited to 'tests/scripts/misc/bs-nl')
-rw-r--r--tests/scripts/misc/bs-nl98
1 files changed, 98 insertions, 0 deletions
diff --git a/tests/scripts/misc/bs-nl b/tests/scripts/misc/bs-nl
index 4fc3f639..fc323ce9 100644
--- a/tests/scripts/misc/bs-nl
+++ b/tests/scripts/misc/bs-nl
@@ -125,5 +125,103 @@ close(MAKEFILE);
run_make_with_options($m2, '', get_logfile());
compare_output("foo bar\n", get_logfile(1));
+# Test different types of whitespace, and bsnl inside functions
+
+sub xlate
+{
+ $_ = $_[0];
+ s/\\r/\r/g;
+ s/\\t/\t/g;
+ s/\\f/\f/g;
+ s/\\v/\v/g;
+ s/\\n/\n/g;
+ return $_;
+}
+
+run_make_test(xlate(q!
+$(foreach\r a \t , b\t c \r ,$(info $a \r ) )
+all:;@:
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+all:;@:$(foreach\r a \t , b\t c \r ,$(info $a \r ) )
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+$(foreach \
+\r a \t\
+ , b\t \
+ c \r ,$(info \
+ $a \r ) \
+ )
+all:;@:
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+all:;@:$(foreach \
+\r a \t\
+ , b\t \
+ c \r ,$(info \
+ $a \r ) \
+ )
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+define FOO
+$(foreach
+\r a \t
+ , b\t
+ c \r ,$(info
+ $a \r )
+ )
+endef
+$(FOO)
+all:;@:
+!),
+ '', "b \r \nc \r \n");
+
+run_make_test(xlate(q!
+define FOO
+$(foreach
+\r a \t
+ , b\t
+ c \r ,$(info
+ $a \r )
+ )
+endef
+all:;@:$(FOO)
+!),
+ '', "b \r \nc \r \n");
+
+# Test variables in recipes that expand to multiple lines
+
+run_make_test(q!
+define var
+
+echo foo
+
+
+echo bar
+endef
+all:;$(var)
+!,
+ '', "echo foo\nfoo\necho bar\nbar\n");
+
+run_make_test(q!
+define var
+
+echo foo
+
+@
+
+echo bar
+endef
+all:;$(var)
+!,
+ '', "echo foo\nfoo\necho bar\nbar\n");
1;