2 # Copyright (C) 2019-2025 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 3, or (at your option) any
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; see the file COPYING3. If not see
16 # <http://www.gnu.org/licenses/>.
18 # This awk script checks that aarch64-sve.md (passed either on the
19 # command line or via stdin) has an up-to-date contents section.
27 # The headings in the comments use a two-level hierarchy: ";; == ..."
28 # for major sections and ";; ---- ..." for minor sections. Each section
29 # heading must be unique.
31 # The contents section should list all the section headings, using the
32 # same text and in the same order. We should therefore see exactly two
33 # copies of the section list.
34 /^
;; ==
/ || /^
;; ---- / {
35 if ($
0 in seen
|| seen2
> 0)
39 printf "error: line not in contents: %s\n", $
0 > "/dev/stderr"
43 if ($
0 != order
[seen2
])
45 printf "error: mismatched contents\n saw: %s\nexpected: %s\n", \
46 $
0, order
[seen2
] > "/dev/stderr"
61 if (seen2
< seen1
&& errors ==
0)
63 printf "error: line only in contents: %s\n", order
[seen2
] > "/dev/stderr"