xref: /freebsd/contrib/bmake/unit-tests/directive-for-lines.mk (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1# $NetBSD: directive-for-lines.mk,v 1.5 2023/06/01 20:56:35 rillig Exp $
2#
3# Tests for the line numbers that are reported in .for loops.
4#
5# Since parse.c 1.127 from 2007-01-01 and before parse.c 1.494 from
6# 2020-12-19, the line numbers for the .info directives and error
7# messages inside .for loops had been wrong since ParseGetLine skipped empty
8# lines, even when collecting the lines for the .for loop body.
9
10.for outer in a b
11
12# comment \
13# continued comment
14
15.for inner in 1 2
16
17# comment \
18# continued comment
19
20VAR= \
21	multi-line
22
23# expect+4: expect 23
24# expect+3: expect 23
25# expect+2: expect 23
26# expect+1: expect 23
27.info expect 23
28
29.endfor
30
31# comment \
32# continued comment
33
34# expect+2: expect 30
35# expect+1: expect 30
36.info expect 30
37
38.endfor
39