Module Name:    src
Committed By:   rillig
Date:           Sun Jul 19 21:03:55 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: cond-short.mk

Log Message:
make(1): add test for assignment operators in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/cond-short.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/cond-short.mk
diff -u src/usr.bin/make/unit-tests/cond-short.mk:1.7 src/usr.bin/make/unit-tests/cond-short.mk:1.8
--- src/usr.bin/make/unit-tests/cond-short.mk:1.7	Thu Jul  9 22:34:09 2020
+++ src/usr.bin/make/unit-tests/cond-short.mk	Sun Jul 19 21:03:55 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-short.mk,v 1.7 2020/07/09 22:34:09 sjg Exp $
+# $NetBSD: cond-short.mk,v 1.8 2020/07/19 21:03:55 rillig Exp $
 #
 # Demonstrates that in conditions, the right-hand side of an && or ||
 # is only evaluated if it can actually influence the result.
@@ -66,6 +66,19 @@ VAR=	# empty again, for the following te
 .if 0 && !empty(:U${:!echo "unexpected exclam modifier" 1>&2 !})
 .endif
 
+# Irrelevant assignment modifiers are skipped as well.
+.if 0 && ${1 2 3:L:@i@${FIRST::?=$i}@}
+.endif
+.if 0 && ${1 2 3:L:@i@${LAST::=$i}@}
+.endif
+.if 0 && ${1 2 3:L:@i@${APPENDED::+=$i}@}
+.endif
+.if 0 && ${echo.1 echo.2 echo.3:L:@i@${RAN::!=${i:C,.*,&; & 1>\&2,:S,., ,g}}@}
+.endif
+.if defined(FIRST) || defined(LAST) || defined(APPENDED) || defined(RAN)
+.warning first=${FIRST} last=${LAST} appended=${APPENDED} ran=${RAN}
+.endif
+
 # The || operator.
 
 .if 1 || ${echo "unexpected or" 1>&2 :L:sh}

Reply via email to