xref: /freebsd/contrib/bmake/unit-tests/directive-endif.mk (revision 5e3190f700637fcfc1a52daeaa4a031fdd2557c7)
1# $NetBSD: directive-endif.mk,v 1.7 2023/06/01 20:56:35 rillig Exp $
2#
3# Tests for the .endif directive.
4#
5# Since 2020-12-15, the .endif directive no longer accepts arguments.
6# The manual page had never allowed that, but the code didn't check it.
7#
8# See also:
9#	Cond_EvalLine
10
11.MAKEFLAGS: -dL
12
13.if 0
14# Since 2020-12-15:
15# expect+1: The .endif directive does not take arguments
16.endif 0
17
18.if 1
19# Since 2020-12-15:
20# expect+1: The .endif directive does not take arguments
21.endif 1
22
23# Comments are allowed after an '.endif'.
24.if 2
25.endif # comment
26
27# Only whitespace and comments are allowed after an '.endif', but nothing
28# else.
29.if 1
30# Since 2020-12-15:
31# expect+1: The .endif directive does not take arguments
32.endif0
33
34# Only whitespace and comments are allowed after an '.endif', but nothing
35# else.
36.if 1
37# Since 2020-12-15:
38# expect+1: The .endif directive does not take arguments
39.endif/
40
41# After an '.endif', no other letter must occur.
42.if 1
43# expect+1: Unknown directive "endifx"
44.endifx
45.endif				# to close the preceding '.if'
46