xref: /freebsd/contrib/bmake/unit-tests/directive-endif.mk (revision 148ee84570001f46b7b667c86573d378101c3801)
1*148ee845SSimon J. Gerraty# $NetBSD: directive-endif.mk,v 1.7 2023/06/01 20:56:35 rillig Exp $
22c3632d1SSimon J. Gerraty#
32c3632d1SSimon J. Gerraty# Tests for the .endif directive.
4e2eeea75SSimon J. Gerraty#
506b9b3e0SSimon J. Gerraty# Since 2020-12-15, the .endif directive no longer accepts arguments.
606b9b3e0SSimon J. Gerraty# The manual page had never allowed that, but the code didn't check it.
706b9b3e0SSimon J. Gerraty#
8e2eeea75SSimon J. Gerraty# See also:
9e2eeea75SSimon J. Gerraty#	Cond_EvalLine
102c3632d1SSimon J. Gerraty
11e2eeea75SSimon J. Gerraty.MAKEFLAGS: -dL
12e2eeea75SSimon J. Gerraty
13e2eeea75SSimon J. Gerraty.if 0
14*148ee845SSimon J. Gerraty# Since 2020-12-15:
15*148ee845SSimon J. Gerraty# expect+1: The .endif directive does not take arguments
16e2eeea75SSimon J. Gerraty.endif 0
17e2eeea75SSimon J. Gerraty
18e2eeea75SSimon J. Gerraty.if 1
19*148ee845SSimon J. Gerraty# Since 2020-12-15:
20*148ee845SSimon J. Gerraty# expect+1: The .endif directive does not take arguments
21e2eeea75SSimon J. Gerraty.endif 1
22e2eeea75SSimon J. Gerraty
23e2eeea75SSimon J. Gerraty# Comments are allowed after an '.endif'.
24e2eeea75SSimon J. Gerraty.if 2
25e2eeea75SSimon J. Gerraty.endif # comment
26e2eeea75SSimon J. Gerraty
2706b9b3e0SSimon J. Gerraty# Only whitespace and comments are allowed after an '.endif', but nothing
2806b9b3e0SSimon J. Gerraty# else.
2906b9b3e0SSimon J. Gerraty.if 1
30*148ee845SSimon J. Gerraty# Since 2020-12-15:
31*148ee845SSimon J. Gerraty# expect+1: The .endif directive does not take arguments
3206b9b3e0SSimon J. Gerraty.endif0
3306b9b3e0SSimon J. Gerraty
3406b9b3e0SSimon J. Gerraty# Only whitespace and comments are allowed after an '.endif', but nothing
3506b9b3e0SSimon J. Gerraty# else.
3606b9b3e0SSimon J. Gerraty.if 1
37*148ee845SSimon J. Gerraty# Since 2020-12-15:
38*148ee845SSimon J. Gerraty# expect+1: The .endif directive does not take arguments
3906b9b3e0SSimon J. Gerraty.endif/
4006b9b3e0SSimon J. Gerraty
41*148ee845SSimon J. Gerraty# After an '.endif', no other letter must occur.
4206b9b3e0SSimon J. Gerraty.if 1
43*148ee845SSimon J. Gerraty# expect+1: Unknown directive "endifx"
4406b9b3e0SSimon J. Gerraty.endifx
4506b9b3e0SSimon J. Gerraty.endif				# to close the preceding '.if'
46