xref: /freebsd/contrib/bmake/unit-tests/directive-for-lines.mk (revision ebacd8013fe5f7fdf9f6a5b286f6680dd2891036)
1# $NetBSD: directive-for-lines.mk,v 1.4 2022/05/08 06:51:27 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.info expect 23
24
25.endfor
26
27# comment \
28# continued comment
29
30.info expect 30
31
32.endfor
33