Module Name:    src
Committed By:   rillig
Date:           Mon Sep 14 18:49:24 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: directive-for.exp directive-for.mk

Log Message:
make(1): add test for nested .for loops with the same variable name


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/directive-for.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-for.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/directive-for.exp
diff -u src/usr.bin/make/unit-tests/directive-for.exp:1.1 src/usr.bin/make/unit-tests/directive-for.exp:1.2
--- src/usr.bin/make/unit-tests/directive-for.exp:1.1	Wed Sep  2 05:33:57 2020
+++ src/usr.bin/make/unit-tests/directive-for.exp	Mon Sep 14 18:49:24 2020
@@ -1 +1,2 @@
+make: "directive-for.mk" line 100: outer
 exit status 0

Index: src/usr.bin/make/unit-tests/directive-for.mk
diff -u src/usr.bin/make/unit-tests/directive-for.mk:1.2 src/usr.bin/make/unit-tests/directive-for.mk:1.3
--- src/usr.bin/make/unit-tests/directive-for.mk:1.2	Wed Sep  2 22:58:59 2020
+++ src/usr.bin/make/unit-tests/directive-for.mk	Mon Sep 14 18:49:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.2 2020/09/02 22:58:59 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.3 2020/09/14 18:49:24 rillig Exp $
 #
 # Tests for the .for directive.
 
@@ -93,5 +93,13 @@ EXPANSION${plus}=	value
 .  error This must be a make from before 2009.
 .endif
 
+# When the outer .for loop is expanded, it sees the expression ${i} and
+# expands it.  The inner loop then has nothing more to expand.
+.for i in outer
+.  for i in inner
+.    info ${i}
+.  endfor
+.endfor
+
 all:
 	@:;

Reply via email to