summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests/directive-for-generating-endif.mk
blob: 3079ad3353c203b69b7b8e59ef14d236f5d8d5bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# $NetBSD: directive-for-generating-endif.mk,v 1.2 2023/06/01 20:56:35 rillig Exp $
#
# Test whether a .for loop can be used to generate multiple .endif
# directives to close nested .if directives.  Depending on the exact
# implementation, this might have been possible.
#
# If it were possible, the 3 .if directives would perfectly match the
# 3 .endif directives generated by the .for loop.
#
# After the "included file" from the .for loop, the 3 .if directives
# are still open.
#
# See For_Run and ParseReadLine.  Each .for loop is treated like a separately
# included file, and in each included file the .if/.endif directives must be
# balanced.

.if 1
.  if 2
.    if 3
.for i in 3 2 1
# expect+3: if-less endif
# expect+2: if-less endif
# expect+1: if-less endif
.endif
.endfor

all:
	@:;
# expect+1: 3 open conditionals