xref: /freebsd/contrib/bmake/unit-tests/varmod-remember.mk (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
1# $NetBSD: varmod-remember.mk,v 1.3 2020/08/23 15:18:43 rillig Exp $
2#
3# Tests for the :_ modifier, which saves the current variable value
4# in the _ variable or another, to be used later again.
5
6# In the parameterized form, having the variable name on the right side of
7# the = assignment operator is confusing.  In almost all other situations
8# the variable name is on the left-hand side of the = operator.  Luckily
9# this modifier is only rarely needed.
10all:
11	@echo ${1 2 3:L:_:@var@${_}@}
12	@echo ${1 2 3:L:@var@${var:_=SAVED:}@}, SAVED=${SAVED}
13