CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Aug 5 09:44:18 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint2: msg_013.exp msg_013.ln Log Message: tests/lint: test C99 printf conversion specifiers in lint2 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_013.exp \ src/tests/usr.bin/xlint/lint2/msg_013.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Aug 5 09:44:18 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint2: msg_013.exp msg_013.ln Log Message: tests/lint: test C99 printf conversion specifiers in lint2 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_013.exp \ src/tests/usr.bin/xlint/lint2/msg_013.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/msg_013.exp diff -u src/tests/usr.bin/xlint/lint2/msg_013.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_013.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_013.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_013.exp Sat Aug 5 09:44:18 2023 @@ -0,0 +1,3 @@ +my_printf: malformed format string local.c(12) +my_printf: malformed format string local.c(13) +my_printf, arg 2 inconsistent with format local.c(13) Index: src/tests/usr.bin/xlint/lint2/msg_013.ln diff -u src/tests/usr.bin/xlint/lint2/msg_013.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_013.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_013.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_013.ln Sat Aug 5 09:44:18 2023 @@ -1,6 +1,18 @@ -# $NetBSD: msg_013.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_013.ln,v 1.2 2023/08/05 09:44:18 rillig Exp $ # # Test data for message 13 of lint2: # %s: malformed format string %s # -# TODO: add actual test data + +0 s local.c +S local.c + +# void my_printf(const char *fmt) {} +4 d 0.4 v 1P 1d 9my_printf F1 PcC V + +# my_printf("%f", 0.0); +11 c 0.11 s1"%f" i 9my_printf f2 PC D V +# my_printf("%a", 0.0); +12 c 0.12 s1"%a" i 9my_printf f2 PC D V +# my_printf("%lf", 0.0L); +13 c 0.13 s1"%lf" i 9my_printf f2 PC lD V
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Fri Apr 1 01:00:40 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint2: msg_016.ln Log Message: tests/lint2: add missing character in comment To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_016.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Fri Apr 1 01:00:40 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint2: msg_016.ln Log Message: tests/lint2: add missing character in comment To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_016.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/msg_016.ln diff -u src/tests/usr.bin/xlint/lint2/msg_016.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_016.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_016.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_016.ln Fri Apr 1 01:00:39 2022 @@ -1,6 +1,6 @@ -# $NetBSD: msg_016.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_016.ln,v 1.2 2022/04/01 01:00:39 rillig Exp $ # # Test data for message 16 of lint2: -# s: too many args for format %s +# %s: too many args for format %s # # TODO: add actual test data
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Jan 15 17:33:42 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint2: emit.ln output_sorted.ln Log Message: tests/lint: fix comments To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/emit.ln cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/output_sorted.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/emit.ln diff -u src/tests/usr.bin/xlint/lint2/emit.ln:1.4 src/tests/usr.bin/xlint/lint2/emit.ln:1.5 --- src/tests/usr.bin/xlint/lint2/emit.ln:1.4 Sat Sep 4 18:34:17 2021 +++ src/tests/usr.bin/xlint/lint2/emit.ln Sat Jan 15 17:33:42 2022 @@ -1,4 +1,4 @@ -# $NetBSD: emit.ln,v 1.4 2021/09/04 18:34:17 rillig Exp $ +# $NetBSD: emit.ln,v 1.5 2022/01/15 17:33:42 rillig Exp $ # # Test emitting a lint library file. @@ -15,8 +15,8 @@ S emit.c 106 d 0.106 t 11defined_int I # Referring to an anonymous tagged type forces the source file to be listed as -# part of the library. If it weren't listed, the diagnostics from lint2 were -# not able to refer to the location where this type has been defined. +# part of the library. If it weren't listed, the diagnostics from lint2 would +# not be able to refer to the location where this type has been defined. 97 d 0.97 e 21extern_anonymous_enum eT395.0.0 # Function declarations, as opposed to function definitions, are not part of a Index: src/tests/usr.bin/xlint/lint2/output_sorted.ln diff -u src/tests/usr.bin/xlint/lint2/output_sorted.ln:1.1 src/tests/usr.bin/xlint/lint2/output_sorted.ln:1.2 --- src/tests/usr.bin/xlint/lint2/output_sorted.ln:1.1 Sat Aug 28 19:45:18 2021 +++ src/tests/usr.bin/xlint/lint2/output_sorted.ln Sat Jan 15 17:33:42 2022 @@ -1,7 +1,8 @@ -# $NetBSD: output_sorted.ln,v 1.1 2021/08/28 19:45:18 rillig Exp $ +# $NetBSD: output_sorted.ln,v 1.2 2022/01/15 17:33:42 rillig Exp $ # # Test whether the output is sorted by symbol name. -# As of 2021-08-28, the output is sorted by hashcode, which looks random. +# Before main2.c 1.21 from 2021-08-28, the output was sorted by hashcode, +# which looked random. Since then, the output is sorted by symbol name. 0 s output_sorted.c S output_sorted.c
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Jan 15 17:33:42 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint2: emit.ln output_sorted.ln Log Message: tests/lint: fix comments To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/emit.ln cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/output_sorted.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Thu Dec 16 09:38:54 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint: fix copy-and-paste typo in comment To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.12 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.13 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.12 Thu Dec 16 03:53:13 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Thu Dec 16 09:38:54 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.12 2021/12/16 03:53:13 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.13 2021/12/16 09:38:54 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -182,7 +182,7 @@ missing_newline_head() missing_newline_body() { - # Before read.c 1.71 from 2021-12-16, the error message was just 'c' + # Before read.c 1.72 from 2021-12-16, the error message was just 'c' # without any textual description or context, and the line number was # off by one, it was reported as line 0.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Thu Dec 16 09:38:54 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint: fix copy-and-paste typo in comment To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Thu Dec 16 03:44:48 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint: demonstrate bad error message on missing newline To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.10 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.11 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.10 Sun Nov 28 09:16:46 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Thu Dec 16 03:44:48 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.10 2021/11/28 09:16:46 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.11 2021/12/16 03:44:48 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -175,6 +175,22 @@ error_cases_body() test_error_ignored '0u0.0x3var_' } +missing_newline_head() +{ + std_head +} + +missing_newline_body() +{ + printf '1d1.1e5func' > 'input.ln' + + # FIXME: The error message is not understandable. + # FIXME: The line number is off by one. + atf_check -s 'exit:1' \ + -e 'match:^.*: error: input\.ln:0: c \(for .1d1\.1e5func.\)$' \ + "$lint2" 'input.ln' +} + atf_init_test_cases() { local i @@ -200,4 +216,5 @@ atf_init_test_cases() done atf_add_test_case 'error_cases' + atf_add_test_case 'missing_newline' }
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Thu Dec 16 03:44:48 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint: demonstrate bad error message on missing newline To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Nov 28 09:10:36 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint2: fix regular expressions containing backslash In regular expressions, a backslash must be doubled. In this case, ATF didn't complain because the single backslashes were used in the pattern '\($2\)', where they produced '\(...\\)'. Omitting the backslash for the closing parenthesis was apparently OK; other regex implementations complain about this. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.8 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.9 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.8 Sun Sep 5 18:17:15 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Sun Nov 28 09:10:36 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.8 2021/09/05 18:17:15 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.9 2021/11/28 09:10:36 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -141,9 +141,9 @@ error_cases_body() test_error '0c0.0s2"' 'trailing data: ' test_error '0c0.0s2"%' 'missing closing quote' # shellcheck disable=SC1003 - test_error '0c0.0s2"\' 'missing after \' + test_error '0c0.0s2"\' 'missing after \\' # shellcheck disable=SC1003 - test_error '0c0.0s2"%\' 'missing after \' + test_error '0c0.0s2"%\' 'missing after \\' # declarations and definitions test_error '0d0' 'bad line number'
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Nov 28 09:10:36 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint2: fix regular expressions containing backslash In regular expressions, a backslash must be doubled. In this case, ATF didn't complain because the single backslashes were used in the pattern '\($2\)', where they produced '\(...\\)'. Omitting the backslash for the closing parenthesis was apparently OK; other regex implementations complain about this. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Sep 12 16:07:16 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_000.ln Log Message: tests/lint: make documentation for lint2/msg_000 less ambiguous To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/msg_000.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Sep 12 16:07:16 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_000.ln Log Message: tests/lint: make documentation for lint2/msg_000 less ambiguous To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/msg_000.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/msg_000.ln diff -u src/tests/usr.bin/xlint/lint2/msg_000.ln:1.2 src/tests/usr.bin/xlint/lint2/msg_000.ln:1.3 --- src/tests/usr.bin/xlint/lint2/msg_000.ln:1.2 Tue Aug 24 23:38:51 2021 +++ src/tests/usr.bin/xlint/lint2/msg_000.ln Sun Sep 12 16:07:16 2021 @@ -1,4 +1,4 @@ -# $NetBSD: msg_000.ln,v 1.2 2021/08/24 23:38:51 rillig Exp $ +# $NetBSD: msg_000.ln,v 1.3 2021/09/12 16:07:16 rillig Exp $ # # Test data for message 0 of lint2: # %s used( %s ), but not defined @@ -14,14 +14,14 @@ S msg_000.c # but not used, generated by this code: # 1: # 2 "msg_000.c" # 2: defined_not_used() { -# 3: used_not_defined(1, 0.0); +# 3: used_not_defined(12345, 0.0); # 4: } # # The function call in line 3 generates this entry: # '3' logical line 3 in the main .c source # 'c' function call # '0.3' file 0, logical line 3 in the currently included file -# 'p1' the first argument is a positive constant +# 'p1' argument 1 is a positive constant # 'i' the return value of the function call is ignored # '16...' the name of the called function # 'f2' it's a function with 2 arguments
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Sep 4 20:39:18 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint: test error handling when reading .ln files To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.6 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.7 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.6 Tue Aug 24 21:30:52 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Sat Sep 4 20:39:17 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.6 2021/08/24 21:30:52 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.7 2021/09/04 20:39:17 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -76,11 +76,108 @@ emit_lp64_body() std_emit_body 'emit_lp64' } +test_error() +{ + printf '%s\n' \ + "$1" + printf '%s\n' \ + '0sinput.ln' \ + 'Sinput.ln' \ + "$1" \ + > 'input.ln' + + atf_check -s 'exit:1' -e "match:input file error: input\\.ln,3 \($2\)\$" \ + "$lint2" 'input.ln' +} + +test_error_ignored() +{ + printf '%s\n' \ + "$1" + printf '%s\n' \ + '0sinput.ln' \ + 'Sinput.ln' \ + "$1" \ + > 'input.ln' + + atf_check -o 'ignore' \ + "$lint2" 'input.ln' +} + +error_cases_head() +{ + std_head +} +error_cases_body() +{ + test_error '' 'missing record type' + test_error '123' 'missing record type' + test_error '0X' 'not a number: ' + test_error '0d' 'not a number: ' + test_error '0dXYZ' 'not a number: XYZ' + test_error '0d123' 'bad line number' + test_error '0d123.XYZ' 'not a number: XYZ' + test_error '0X0.0' 'bad record type X' + + # function calls + test_error '0c0.0' 'not a number: ' + test_error '0c0.0uu' 'used or discovered: u' + test_error '0c0.0du' 'used or discovered: u' + test_error '0c0.0ui' 'used or discovered: i' + test_error '0c0.0di' 'used or discovered: i' + test_error '0c0.0ud' 'used or discovered: d' + test_error '0c0.0dd' 'used or discovered: d' + # Unlike 'd' and 'u', the 'i' may be repeated. + test_error '0c0.0iii1n_' 'bad type: _ ' + # Negative argument numbers like in 'z-1' are accepted but ignored. + test_error '0c0.0z-1d_' 'not a number: _' + # Argument 1 is both positive '1p' and negative '1n', which is + # impossible in practice. It is not worth handling this though since + # only lint1 generates these .ln files. + test_error '0c0.0p1n1d_' 'not a number: _' + test_error '0c0.0s' 'not a number: ' + test_error '0c0.0s2' 'not quote: ' + test_error '0c0.0s2|' 'not quote: |' + test_error '0c0.0s2"' 'trailing data: ' + test_error '0c0.0s2"%' 'missing closing quote' + # shellcheck disable=SC1003 + test_error '0c0.0s2"\' 'missing after \' + # shellcheck disable=SC1003 + test_error '0c0.0s2"%\' 'missing after \' + + # declarations and definitions + test_error '0d0' 'bad line number' + test_error '0d0.0' 'not a number: ' + test_error '0d0.0dd' 'def' + test_error '0d0.0de' 'decl' + test_error '0d0.0ee' 'decl' + test_error '0d0.0ii' 'inline' + test_error '0d0.0oo' 'osdef' + test_error '0d0.0rr' 'r' + test_error '0d0.0ss' 'static' + test_error '0d0.0tt' 'tdef' + test_error '0d0.0uu' 'used' + test_error '0d0.0v1v1' 'v' + test_error '0d0.0P1P1' 'P' + test_error '0d0.0S1S1' 'S' + test_error '0d0.0v1P1S_' 'not a number: _' + test_error '0d0.0d3var_' 'bad type: _ ' + test_error '0d0.0d3varPV_' 'trailing line: _' + + # usage of a variable or a function + test_error '0u0.0' 'bad delim ' + test_error '0u0.0_' 'bad delim _' + test_error '0u0.0x' 'not a number: ' + # trailing garbage is not detected + test_error_ignored '0u0.0x3var_' +} + atf_init_test_cases() { local i # shellcheck disable=SC2013 + # shellcheck disable=SC2035 for i in $(cd "$(atf_get_srcdir)" && echo *.ln); do i=${i%.ln} @@ -98,4 +195,6 @@ atf_init_test_cases() || eval "${i}_body() { std_body '$i'; }" atf_add_test_case "$i" done + + atf_add_test_case 'error_cases' }
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Sep 4 20:39:18 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: t_lint2.sh Log Message: tests/lint: test error handling when reading .ln files To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Sep 4 18:34:17 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: emit.exp-ln emit.ln Log Message: tests/lint: test old-style functions in a lint library To really qualify as old-style, a function must not declare a return type in its definition. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/emit.exp-ln cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/emit.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/emit.exp-ln diff -u src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.4 src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.5 --- src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.4 Sat Sep 4 18:26:35 2021 +++ src/tests/usr.bin/xlint/lint2/emit.exp-ln Sat Sep 4 18:34:17 2021 @@ -1,4 +1,4 @@ -# $NetBSD: emit.exp-ln,v 1.4 2021/09/04 18:26:35 rillig Exp $ +# $NetBSD: emit.exp-ln,v 1.5 2021/09/04 18:34:17 rillig Exp $ S llib-lemit.ln 0 s llib-lemit.ln @@ -26,6 +26,9 @@ S llib-lemit.ln 0 d 0.0 v1 S1 du 14func_scanflike f1 PC I 0 d 0.0 v1 du 12func_varargs F2 PC E I +0 d 0.0 d r o u 13old_style_int f0 I +0 d 0.0 d o u 14old_style_void f0 I + # the variables for the basic types 0 d 0.0 du 9var__Bool B 0 d 0.0 du 19var_array_of_double A7D Index: src/tests/usr.bin/xlint/lint2/emit.ln diff -u src/tests/usr.bin/xlint/lint2/emit.ln:1.3 src/tests/usr.bin/xlint/lint2/emit.ln:1.4 --- src/tests/usr.bin/xlint/lint2/emit.ln:1.3 Sat Sep 4 18:26:35 2021 +++ src/tests/usr.bin/xlint/lint2/emit.ln Sat Sep 4 18:34:17 2021 @@ -1,4 +1,4 @@ -# $NetBSD: emit.ln,v 1.3 2021/09/04 18:26:35 rillig Exp $ +# $NetBSD: emit.ln,v 1.4 2021/09/04 18:34:17 rillig Exp $ # # Test emitting a lint library file. @@ -83,4 +83,10 @@ S expr_promote.c 0 d 0.0 v1 d 12func_varargs F2 PC E I 0 d 0.0 v1 P1 d 15func_printflike f1 PC I 0 d 0.0 v1 S1 d 14func_scanflike f1 PC I + +# old_style_void() {} +0 d 0.0 d o 14old_style_void f0 I +# old_style_int() { return 1; } +0 d 0.0 d r o 13old_style_int f0 I + # TODO: find out how traditional C defined a varargs function
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Sep 4 18:34:17 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: emit.exp-ln emit.ln Log Message: tests/lint: test old-style functions in a lint library To really qualify as old-style, a function must not declare a return type in its definition. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/emit.exp-ln cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/emit.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Sep 4 18:26:36 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: emit.exp-ln emit.ln Log Message: tests/lint: test writing of a lint library The code for that is almost the same as in lint1, but only almost. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/emit.exp-ln cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/emit.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/emit.exp-ln diff -u src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.3 src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.4 --- src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.3 Sat Aug 28 17:18:42 2021 +++ src/tests/usr.bin/xlint/lint2/emit.exp-ln Sat Sep 4 18:26:35 2021 @@ -1,4 +1,4 @@ -# $NetBSD: emit.exp-ln,v 1.3 2021/08/28 17:18:42 rillig Exp $ +# $NetBSD: emit.exp-ln,v 1.4 2021/09/04 18:26:35 rillig Exp $ S llib-lemit.ln 0 s llib-lemit.ln @@ -19,3 +19,45 @@ S llib-lemit.ln # from emit.c 0 d 0.0 d u 14cover_outqchar F0 V 0 d 0.0 t u 11defined_int I + +0 d 0.0 du 28func_old_style_parameterless f0 D +0 d 0.0 du 25func_old_style_parameters f2 PC I D +0 d 0.0 v1 P1 du 15func_printflike f1 PC I +0 d 0.0 v1 S1 du 14func_scanflike f1 PC I +0 d 0.0 v1 du 12func_varargs F2 PC E I + +# the variables for the basic types +0 d 0.0 du 9var__Bool B +0 d 0.0 du 19var_array_of_double A7D +0 d 0.0 du 10var_double D +0 d 0.0 du 18var_double_complex X +0 d 0.0 du 18var_enum_anonymous eT3 0.2.0 +0 d 0.0 du 12var_enum_tage T1 8enum_tag +0 d 0.0 du 16var_enum_typedef eT2 12enum_typedef +0 d 0.0 du 9var_float sD +0 d 0.0 du 17var_float_complex sX +0 d 0.0 du 15var_long_double lD +0 d 0.0 du 23var_long_double_complex lX +0 d 0.0 du 14var_plain_char C +0 d 0.0 du 18var_pointer_to_int PI +0 d 0.0 du 33var_pointer_to_old_style_function PFI +0 d 0.0 du 37var_pointer_to_parameterless_function PF0 I +0 d 0.0 du 33var_pointer_to_prototype_function PF2 PcvC I I +0 d 0.0 du 31var_pointer_to_varargs_function PF3 PcC I E I +0 d 0.0 du 19var_pointer_to_void PV +0 d 0.0 du 15var_signed_char sC +0 d 0.0 du 14var_signed_int I +0 d 0.0 du 15var_signed_long L +0 d 0.0 du 20var_signed_long_long Q +0 d 0.0 du 16var_signed_short S +0 d 0.0 du 20var_struct_anonymous sT3 0.2.0 +0 d 0.0 du 14var_struct_tag sT1 10struct_tag +0 d 0.0 du 18var_struct_typedef sT 2 14struct_typedef +0 d 0.0 du 19var_union_anonymous uT3 0.2.0 +0 d 0.0 du 13var_union_tag uT1 9union_tag +0 d 0.0 du 17var_union_typedef uT2 13union_typedef +0 d 0.0 du 17var_unsigned_char uC +0 d 0.0 du 16var_unsigned_int uI +0 d 0.0 du 17var_unsigned_long uL +0 d 0.0 du 22var_unsigned_long_long uQ +0 d 0.0 du 18var_unsigned_short uS Index: src/tests/usr.bin/xlint/lint2/emit.ln diff -u src/tests/usr.bin/xlint/lint2/emit.ln:1.2 src/tests/usr.bin/xlint/lint2/emit.ln:1.3 --- src/tests/usr.bin/xlint/lint2/emit.ln:1.2 Tue Aug 24 23:38:51 2021 +++ src/tests/usr.bin/xlint/lint2/emit.ln Sat Sep 4 18:26:35 2021 @@ -1,4 +1,4 @@ -# $NetBSD: emit.ln,v 1.2 2021/08/24 23:38:51 rillig Exp $ +# $NetBSD: emit.ln,v 1.3 2021/09/04 18:26:35 rillig Exp $ # # Test emitting a lint library file. @@ -39,3 +39,48 @@ S expr_promote.c 10 d 0.10 e 4sink F2 PcC E V 58 c 0.58 i 4sink f20 PcC B I I I I I I uI L uL Q uQ D D lD sX X lX eT331.0.0 V 37 d 0.37 d 6caller F1 PsT116arithmetic_types V + +# Emit all basic types. +0 d 0.0 d 9var__Bool B +0 d 0.0 d 14var_plain_char C +0 d 0.0 d 15var_signed_char sC +0 d 0.0 d 17var_unsigned_char uC +0 d 0.0 d 16var_signed_short S +0 d 0.0 d 18var_unsigned_short uS +0 d 0.0 d 14var_signed_int I +0 d 0.0 d 16var_unsigned_int uI +0 d 0.0 d 15var_signed_long L +0 d 0.0 d 17var_unsigned_long uL +0 d 0.0 d 20var_signed_long_long Q +0 d 0.0 d 22var_unsigned_long_long uQ +# see emit_lp64 for __int128_t +# see emit_lp64 for __uint128_t +0 d 0.0 d 9var_float sD +0 d 0.0 d 10var_double D +0 d 0.0 d 15var_long_double lD +0 d 0.0 d 19var_pointer_to_void PV +0 d 0.0 d 14var_struct_tag sT1 10struct_tag +0 d 0.0 d 18var_struct_typedef sT2 14struct_typedef +0 d 0.0 d 20var_struct_anonymous sT3 0.0.0 +0 d 0.0 d 13var_union_tag uT1 9union_tag +0 d 0.0 d 17var_union_typedef uT2 13union_typedef +0 d 0.0 d 19var_union_anonymous uT3 0.0.0 +0 d 0.0 d 12var_enum_tag eT1 8enum_tag +0 d 0.0 d 16var_enum_typedef eT2 12enum_typedef +0 d 0.0 d 18var_enum_anonymous eT3 0.0.0 +0 d 0.0 d 18var_pointer_to_int PI +0 d 0.0 d 19var_array_of_double A7D +0 d 0.0 d 33var_pointer_to_old_style_function P F I +0 d 0.0 d 37var_pointer_to_parameterless_function P F0 I +0 d 0.0 d 33var_pointer_to_prototype_function P F2 PcvC I I +0 d 0.0 d 31var_pointer_to_varargs_function P F3 PcC I E I +0 d 0.0 d 17var_float_complex sX +0 d 0.0 d 18var_double_complex X +0 d 0.0 d 23var_long_double_complex lX + +0 d 0.0 d 28func_old_style_parameterless f0 D +0 d 0.0 d 25func_old_style_parameters f2 PC I D +0 d 0.0 v1 d 12func_varargs
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Sep 4 18:26:36 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: emit.exp-ln emit.ln Log Message: tests/lint: test writing of a lint library The code for that is almost the same as in lint1, but only almost. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/emit.exp-ln cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/emit.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Mon Aug 30 20:11:56 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: read.exp read.ln Log Message: tests/lint: test reading of varargs, printflike, scanflike To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/read.exp cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/read.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Mon Aug 30 20:11:56 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: read.exp read.ln Log Message: tests/lint: test reading of varargs, printflike, scanflike To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/read.exp cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/read.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/read.exp diff -u src/tests/usr.bin/xlint/lint2/read.exp:1.2 src/tests/usr.bin/xlint/lint2/read.exp:1.3 --- src/tests/usr.bin/xlint/lint2/read.exp:1.2 Mon Aug 30 19:07:57 2021 +++ src/tests/usr.bin/xlint/lint2/read.exp Mon Aug 30 20:11:56 2021 @@ -1,2 +1,12 @@ a125 declared( read.c(125) ), but never used or defined bpf_set_error defined( read.c(400) ), but never used +printflike_0_comment defined( read.c(217) ), but never used +printflike_10_comment defined( read.c(229) ), but never used +printflike_3_comment defined( read.c(223) ), but never used +printflike_comment defined( read.c(211) ), but never used +scanflike_0_comment defined( read.c(243) ), but never used +scanflike_3_comment defined( read.c(249) ), but never used +scanflike_comment defined( read.c(237) ), but never used +varargs_0_comment defined( read.c(199) ), but never used +varargs_3_comment defined( read.c(205) ), but never used +varargs_comment defined( read.c(193) ), but never used Index: src/tests/usr.bin/xlint/lint2/read.ln diff -u src/tests/usr.bin/xlint/lint2/read.ln:1.3 src/tests/usr.bin/xlint/lint2/read.ln:1.4 --- src/tests/usr.bin/xlint/lint2/read.ln:1.3 Mon Aug 30 19:07:57 2021 +++ src/tests/usr.bin/xlint/lint2/read.ln Mon Aug 30 20:11:56 2021 @@ -1,4 +1,4 @@ -# $NetBSD: read.ln,v 1.3 2021/08/30 19:07:57 rillig Exp $ +# $NetBSD: read.ln,v 1.4 2021/08/30 20:11:56 rillig Exp $ # # Cover each path of reading declarations, definitions and usages. @@ -67,3 +67,17 @@ S read.c # The corresponding tests for parsing vararg, printflike and scanflike are # still missing, that's why it got through unnoticed. 400 d 0.439 v0 d 13bpf_set_error F3 PsT115_compiler_state PcC E V + +# Taken from ../lint1/emit.exp-ln. +193 d 0.193 v0 d 15varargs_comment F1 PcC V +199 d 0.199 v0 d 17varargs_0_comment F1 PcC V +205 d 0.205 v3 d 17varargs_3_comment F4 I I I PcC V +# The PRINTFLIKE information is only emitted if its argument is > 0. +211 d 0.211 d 18printflike_commentF1 PcC V +217 d 0.217 d 20printflike_0_comment F1 PcC V +223 d 0.223 v3 P3 d 20printflike_3_comment F3 I I PcC V +229 d 0.229 v10 P10 d 21printflike_10_comment F10 I I I I I I I I I PcC V +# The SCANFLIKE information is only emitted if its argument is > 0. +237 d 0.237 d 17scanflike_comment F1 PcC V +243 d 0.243 d 19scanflike_0_comment F1 PcC V +249 d 0.249 v3 S3 d 19scanflike_3_comment F3 I I PcC V
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Tue Aug 24 23:38:51 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: emit.exp-ln emit.ln emit_lp64.exp-ln emit_lp64.ln msg_000.ln msg_001.ln msg_002.ln msg_003.ln msg_004.ln msg_005.ln msg_006.ln msg_008.ln msg_009.ln msg_010.ln msg_011.ln msg_012.ln read.ln read_lp64.ln read_printf.ln Log Message: tests/lint: normalize whitespace in lint2 tests Found a typo in read.ln, f124, which had just 'F' instead of the intended 'F0'. Other than that, only whitespace changes. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/emit.exp-ln \ src/tests/usr.bin/xlint/lint2/emit.ln \ src/tests/usr.bin/xlint/lint2/emit_lp64.exp-ln \ src/tests/usr.bin/xlint/lint2/emit_lp64.ln \ src/tests/usr.bin/xlint/lint2/msg_000.ln \ src/tests/usr.bin/xlint/lint2/read.ln \ src/tests/usr.bin/xlint/lint2/read_lp64.ln cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/msg_001.ln cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/msg_002.ln \ src/tests/usr.bin/xlint/lint2/msg_003.ln \ src/tests/usr.bin/xlint/lint2/msg_004.ln \ src/tests/usr.bin/xlint/lint2/msg_005.ln \ src/tests/usr.bin/xlint/lint2/msg_006.ln \ src/tests/usr.bin/xlint/lint2/msg_008.ln \ src/tests/usr.bin/xlint/lint2/msg_009.ln \ src/tests/usr.bin/xlint/lint2/msg_010.ln \ src/tests/usr.bin/xlint/lint2/msg_011.ln \ src/tests/usr.bin/xlint/lint2/msg_012.ln \ src/tests/usr.bin/xlint/lint2/read_printf.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/emit.exp-ln diff -u src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.1 src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.2 --- src/tests/usr.bin/xlint/lint2/emit.exp-ln:1.1 Tue Aug 24 21:30:52 2021 +++ src/tests/usr.bin/xlint/lint2/emit.exp-ln Tue Aug 24 23:38:51 2021 @@ -1,7 +1,7 @@ -# $NetBSD: emit.exp-ln,v 1.1 2021/08/24 21:30:52 rillig Exp $ +# $NetBSD: emit.exp-ln,v 1.2 2021/08/24 23:38:51 rillig Exp $ S llib-lemit.ln -0s llib-lemit.ln +0 s llib-lemit.ln # Normally, it does not matter in which filename a particular symbol is # defined. Only in cases where a file defines an anonymous tag type (struct, Index: src/tests/usr.bin/xlint/lint2/emit.ln diff -u src/tests/usr.bin/xlint/lint2/emit.ln:1.1 src/tests/usr.bin/xlint/lint2/emit.ln:1.2 --- src/tests/usr.bin/xlint/lint2/emit.ln:1.1 Tue Aug 24 21:30:52 2021 +++ src/tests/usr.bin/xlint/lint2/emit.ln Tue Aug 24 23:38:51 2021 @@ -1,9 +1,9 @@ -# $NetBSD: emit.ln,v 1.1 2021/08/24 21:30:52 rillig Exp $ +# $NetBSD: emit.ln,v 1.2 2021/08/24 23:38:51 rillig Exp $ # # Test emitting a lint library file. # Extracted from ../lint1/emit.exp-ln. -0s emit.c +0 s emit.c S emit.c # Global variables that are declared using 'extern' are not part of a @@ -23,17 +23,17 @@ S emit.c # library's interface, therefore they are omitted from the output. 121 d 0.121 e 30return_void_unknown_parameters F V 122 d 0.122 e 38return_implicit_int_unknown_parameters F I -125 d 0.125 e 32extern_return_void_no_parameters F 0 V +125 d 0.125 e 32extern_return_void_no_parameters F0 V # Function calls are not part of a library's interface, therefore they are # omitted from the output. -161 c 0.161 s2 "%" i 9my_printf f2 PcC PC V +161 c 0.161 s2"%" i 9my_printf f2 PcC PC V # Function definitions are copied to the output. 159 d 0.159 d 14cover_outqchar F0 V # Taken from ../lint1/expr_promote.exp-ln. -0s expr_promote.c +0 s expr_promote.c S expr_promote.c 10 d 0.10 e 4sink F2 PcC E V Index: src/tests/usr.bin/xlint/lint2/emit_lp64.exp-ln diff -u src/tests/usr.bin/xlint/lint2/emit_lp64.exp-ln:1.1 src/tests/usr.bin/xlint/lint2/emit_lp64.exp-ln:1.2 --- src/tests/usr.bin/xlint/lint2/emit_lp64.exp-ln:1.1 Tue Aug 24 21:30:52 2021 +++ src/tests/usr.bin/xlint/lint2/emit_lp64.exp-ln Tue Aug 24 23:38:51 2021 @@ -1,7 +1,7 @@ -# $NetBSD: emit_lp64.exp-ln,v 1.1 2021/08/24 21:30:52 rillig Exp $ +# $NetBSD: emit_lp64.exp-ln,v 1.2 2021/08/24 23:38:51 rillig Exp $ S llib-lemit_lp64.ln -0s llib-lemit_lp64.ln +0 s llib-lemit_lp64.ln 0 d 0.0 du 16uint128_function F0 uJ 0 d 0.0 tu 15int128_variable J Index: src/tests/usr.bin/xlint/lint2/emit_lp64.ln diff -u src/tests/usr.bin/xlint/lint2/emit_lp64.ln:1.1 src/tests/usr.bin/xlint/lint2/emit_lp64.ln:1.2 --- src/tests/usr.bin/xlint/lint2/emit_lp64.ln:1.1 Tue Aug 24 21:30:52 2021 +++ src/tests/usr.bin/xlint/lint2/emit_lp64.ln Tue Aug 24 23:38:51 2021 @@ -1,11 +1,11 @@ -# $NetBSD: emit_lp64.ln,v 1.1 2021/08/24 21:30:52 rillig Exp $ +# $NetBSD: emit_lp64.ln,v 1.2 2021/08/24 23:38:51 rillig Exp $ # # Test emitting a lint library file on an LP64 platform. -0s first-file.c +0 s first-file.c S first-file.c 10 d 0.10 t 15int128_variable J -0s second-file.c +0 s second-file.c S second-file.c 20 d 0.20 d 16uint128_function F0 uJ
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Tue Aug 24 23:38:51 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: emit.exp-ln emit.ln emit_lp64.exp-ln emit_lp64.ln msg_000.ln msg_001.ln msg_002.ln msg_003.ln msg_004.ln msg_005.ln msg_006.ln msg_008.ln msg_009.ln msg_010.ln msg_011.ln msg_012.ln read.ln read_lp64.ln read_printf.ln Log Message: tests/lint: normalize whitespace in lint2 tests Found a typo in read.ln, f124, which had just 'F' instead of the intended 'F0'. Other than that, only whitespace changes. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/emit.exp-ln \ src/tests/usr.bin/xlint/lint2/emit.ln \ src/tests/usr.bin/xlint/lint2/emit_lp64.exp-ln \ src/tests/usr.bin/xlint/lint2/emit_lp64.ln \ src/tests/usr.bin/xlint/lint2/msg_000.ln \ src/tests/usr.bin/xlint/lint2/read.ln \ src/tests/usr.bin/xlint/lint2/read_lp64.ln cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint2/msg_001.ln cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/msg_002.ln \ src/tests/usr.bin/xlint/lint2/msg_003.ln \ src/tests/usr.bin/xlint/lint2/msg_004.ln \ src/tests/usr.bin/xlint/lint2/msg_005.ln \ src/tests/usr.bin/xlint/lint2/msg_006.ln \ src/tests/usr.bin/xlint/lint2/msg_008.ln \ src/tests/usr.bin/xlint/lint2/msg_009.ln \ src/tests/usr.bin/xlint/lint2/msg_010.ln \ src/tests/usr.bin/xlint/lint2/msg_011.ln \ src/tests/usr.bin/xlint/lint2/msg_012.ln \ src/tests/usr.bin/xlint/lint2/read_printf.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Aug 14 14:25:51 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_008.exp msg_008.ln msg_009.exp msg_009.ln msg_010.exp msg_010.ln Log Message: tests/lint: add tests for messages 8, 9 and 10 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_008.exp \ src/tests/usr.bin/xlint/lint2/msg_008.ln \ src/tests/usr.bin/xlint/lint2/msg_009.exp \ src/tests/usr.bin/xlint/lint2/msg_009.ln \ src/tests/usr.bin/xlint/lint2/msg_010.exp \ src/tests/usr.bin/xlint/lint2/msg_010.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/msg_008.exp diff -u src/tests/usr.bin/xlint/lint2/msg_008.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_008.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_008.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_008.exp Sat Aug 14 14:25:51 2021 @@ -0,0 +1 @@ +func returns value which is always ignored Index: src/tests/usr.bin/xlint/lint2/msg_008.ln diff -u src/tests/usr.bin/xlint/lint2/msg_008.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_008.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_008.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_008.ln Sat Aug 14 14:25:51 2021 @@ -1,6 +1,16 @@ -# $NetBSD: msg_008.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_008.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $ # # Test data for message 8 of lint2: # %s returns value which is always ignored # -# TODO: add actual test data + +0smsg_008.c +Smsg_008.c + +# 100: bool func(void) { return true } +100 d 0.100 drs 4func F0 B + +# 110: func(); +110 c 0.110 i 4func f0 B +# 111: func(); +111 c 0.111 i 4func f0 B Index: src/tests/usr.bin/xlint/lint2/msg_009.exp diff -u src/tests/usr.bin/xlint/lint2/msg_009.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_009.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_009.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_009.exp Sat Aug 14 14:25:51 2021 @@ -0,0 +1 @@ +func returns value which is sometimes ignored Index: src/tests/usr.bin/xlint/lint2/msg_009.ln diff -u src/tests/usr.bin/xlint/lint2/msg_009.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_009.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_009.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_009.ln Sat Aug 14 14:25:51 2021 @@ -1,6 +1,16 @@ -# $NetBSD: msg_009.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_009.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $ # # Test data for message 9 of lint2: # %s returns value which is sometimes ignored # -# TODO: add actual test data + +0smsg_009.c +Smsg_009.c + +# 100: bool func(void) { return true } +100 d 0.100 drs 4func F0 B + +# 110: var = func(); +110 c 0.110 u 4func f0 B +# 111: func(); +111 c 0.111 i 4func f0 B Index: src/tests/usr.bin/xlint/lint2/msg_010.exp diff -u src/tests/usr.bin/xlint/lint2/msg_010.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_010.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_010.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_010.exp Sat Aug 14 14:25:51 2021 @@ -0,0 +1 @@ +func value is used( msg_010.c?(30) ), but none returned Index: src/tests/usr.bin/xlint/lint2/msg_010.ln diff -u src/tests/usr.bin/xlint/lint2/msg_010.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_010.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_010.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_010.ln Sat Aug 14 14:25:51 2021 @@ -1,6 +1,17 @@ -# $NetBSD: msg_010.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_010.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $ # # Test data for message 10 of lint2: # %s value is used( %s ), but none returned # -# TODO: add actual test data + +0 s msg_010.c +S msg_010.c +1 s msg_010_use.c + +# msg_010.c:10: func() {} +10 d 0.10 d o 4func f0I + +# msg_010_use.c:20: func(); +20 d 1.20 e 4func F I +# msg_010_use.c:30: use() { return func(); } +30 c 1.30 u 4func f 0 I
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Aug 14 14:25:51 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_008.exp msg_008.ln msg_009.exp msg_009.ln msg_010.exp msg_010.ln Log Message: tests/lint: add tests for messages 8, 9 and 10 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_008.exp \ src/tests/usr.bin/xlint/lint2/msg_008.ln \ src/tests/usr.bin/xlint/lint2/msg_009.exp \ src/tests/usr.bin/xlint/lint2/msg_009.ln \ src/tests/usr.bin/xlint/lint2/msg_010.exp \ src/tests/usr.bin/xlint/lint2/msg_010.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Aug 8 16:35:15 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: Makefile t_lint2.sh Log Message: tests/lint: include but don't run read_lp64 on 32-bit platforms The lint1 tests are all in the machine-independent file list, which makes it easier to manage them. At run time, some of them are skipped based on platform characteristics. Do the same for the lint2 tests. Having the lint2 test named read_lp64 as the only machine-dependent test would complicate things. The build for i386 had failed because the files for read_lp64 were listed in distrib/sets/lists/tests/mi but were not actually installed. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint2/Makefile cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/Makefile diff -u src/tests/usr.bin/xlint/lint2/Makefile:1.5 src/tests/usr.bin/xlint/lint2/Makefile:1.6 --- src/tests/usr.bin/xlint/lint2/Makefile:1.5 Sun Aug 8 13:22:22 2021 +++ src/tests/usr.bin/xlint/lint2/Makefile Sun Aug 8 16:35:15 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2021/08/08 13:22:22 rillig Exp $ +# $NetBSD: Makefile,v 1.6 2021/08/08 16:35:15 rillig Exp $ NOMAN= yes @@ -6,7 +6,7 @@ NOMAN= yes TESTSDIR= ${TESTSBASE}/usr.bin/xlint/lint2 -TESTS_SH= t_lint2 +TESTS_SH= t_lint2 FILESDIR= ${TESTSDIR} @@ -16,9 +16,7 @@ FILESDIR= ${TESTSDIR} TESTS+= msg_${msg} .endfor TESTS+= read -.if ${MACHINE_ARCH:M*64} && !${MACHINE_ARCH:Mmips64*} -TESTS+= read_lp64 # only on 64-bit platforms -.endif +TESTS+= read_lp64 TESTS+= read_printf FILES+= ${TESTS:=.ln} ${TESTS:=.exp} Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.4 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.5 --- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.4 Sun Aug 8 00:02:02 2021 +++ src/tests/usr.bin/xlint/lint2/t_lint2.sh Sun Aug 8 16:35:15 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_lint2.sh,v 1.4 2021/08/08 00:02:02 rillig Exp $ +# $NetBSD: t_lint2.sh,v 1.5 2021/08/08 16:35:15 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -51,6 +51,15 @@ atf_init_test_cases() # shellcheck disable=SC2013 for i in $(cd "$(atf_get_srcdir)" && echo *.ln); do i=${i%.ln} + + case "$i" in + *lp64*) + case "$(uname -p)" in + *64) ;; + *) continue + esac + esac + eval "${i}_head() { std_head; }" eval "${i}_body() { std_body '$i'; }" atf_add_test_case "$i"
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Aug 8 16:35:15 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: Makefile t_lint2.sh Log Message: tests/lint: include but don't run read_lp64 on 32-bit platforms The lint1 tests are all in the machine-independent file list, which makes it easier to manage them. At run time, some of them are skipped based on platform characteristics. Do the same for the lint2 tests. Having the lint2 test named read_lp64 as the only machine-dependent test would complicate things. The build for i386 had failed because the files for read_lp64 were listed in distrib/sets/lists/tests/mi but were not actually installed. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint2/Makefile cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/t_lint2.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Aug 8 13:22:22 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: Makefile Log Message: tests/lint: mips64 is not a 64-bit platform See usr.bin/xlint/arch/mips64/targparam.h. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/Makefile diff -u src/tests/usr.bin/xlint/lint2/Makefile:1.4 src/tests/usr.bin/xlint/lint2/Makefile:1.5 --- src/tests/usr.bin/xlint/lint2/Makefile:1.4 Sun Aug 8 00:02:02 2021 +++ src/tests/usr.bin/xlint/lint2/Makefile Sun Aug 8 13:22:22 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2021/08/08 00:02:02 rillig Exp $ +# $NetBSD: Makefile,v 1.5 2021/08/08 13:22:22 rillig Exp $ NOMAN= yes @@ -16,8 +16,8 @@ FILESDIR= ${TESTSDIR} TESTS+= msg_${msg} .endfor TESTS+= read -.if ${MACHINE_ARCH:M*64} # close enough to "is a 64-bit platform" -TESTS+= read_lp64 +.if ${MACHINE_ARCH:M*64} && !${MACHINE_ARCH:Mmips64*} +TESTS+= read_lp64 # only on 64-bit platforms .endif TESTS+= read_printf
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sun Aug 8 13:22:22 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: Makefile Log Message: tests/lint: mips64 is not a 64-bit platform See usr.bin/xlint/arch/mips64/targparam.h. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint2/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Aug 7 19:07:03 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_001.exp msg_001.ln msg_003.exp msg_003.ln msg_004.exp msg_004.ln msg_005.exp msg_005.ln msg_006.exp msg_006.ln msg_011.exp msg_011.ln msg_012.exp msg_012.ln Log Message: tests/lint: add more tests for lint2 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/msg_001.exp \ src/tests/usr.bin/xlint/lint2/msg_001.ln cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_003.exp \ src/tests/usr.bin/xlint/lint2/msg_003.ln \ src/tests/usr.bin/xlint/lint2/msg_004.exp \ src/tests/usr.bin/xlint/lint2/msg_004.ln \ src/tests/usr.bin/xlint/lint2/msg_005.exp \ src/tests/usr.bin/xlint/lint2/msg_005.ln \ src/tests/usr.bin/xlint/lint2/msg_006.exp \ src/tests/usr.bin/xlint/lint2/msg_006.ln \ src/tests/usr.bin/xlint/lint2/msg_011.exp \ src/tests/usr.bin/xlint/lint2/msg_011.ln \ src/tests/usr.bin/xlint/lint2/msg_012.exp \ src/tests/usr.bin/xlint/lint2/msg_012.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/msg_001.exp diff -u src/tests/usr.bin/xlint/lint2/msg_001.exp:1.2 src/tests/usr.bin/xlint/lint2/msg_001.exp:1.3 --- src/tests/usr.bin/xlint/lint2/msg_001.exp:1.2 Fri Aug 6 16:21:00 2021 +++ src/tests/usr.bin/xlint/lint2/msg_001.exp Sat Aug 7 19:07:03 2021 @@ -1,2 +1,2 @@ -defined_not_used defined( msg_000.c(2) ), but never used -used_not_defined used( msg_000.c(3) ), but not defined +defined_not_used defined( msg_001.c(2) ), but never used +used_not_defined used( msg_001.c(3) ), but not defined Index: src/tests/usr.bin/xlint/lint2/msg_001.ln diff -u src/tests/usr.bin/xlint/lint2/msg_001.ln:1.2 src/tests/usr.bin/xlint/lint2/msg_001.ln:1.3 --- src/tests/usr.bin/xlint/lint2/msg_001.ln:1.2 Fri Aug 6 16:21:00 2021 +++ src/tests/usr.bin/xlint/lint2/msg_001.ln Sat Aug 7 19:07:03 2021 @@ -1,11 +1,25 @@ -# $NetBSD: msg_001.ln,v 1.2 2021/08/06 16:21:00 rillig Exp $ +# $NetBSD: msg_001.ln,v 1.3 2021/08/07 19:07:03 rillig Exp $ # # Test data for message 1 of lint2: # %s defined( %s ), but never used # -0smsg_000.c -Smsg_000.c +0smsg_001.c +Smsg_001.c 3c0.3p1i16used_not_definedf2IDI 2d0.2do16defined_not_usedf0I + +# The function 'main' always counts as used. +# int main(void) {} +10d0.10d4mainF0I +# extern main() {} +12d0.12e4mainFI + +# If a function is declared once in old style and once with prototype, +# the prototype definition is preferred; see chkname. +# +# extern merge_old_style_and_prototype(); +20d0.20e29merge_old_style_and_prototypeFI +# extern int merge_old_style_and_prototype(char *); +21d0.21e29merge_old_style_and_prototypeF1PCI Index: src/tests/usr.bin/xlint/lint2/msg_003.exp diff -u src/tests/usr.bin/xlint/lint2/msg_003.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_003.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_003.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_003.exp Sat Aug 7 19:07:03 2021 @@ -0,0 +1,2 @@ +function defined( msg_003_a.c(10) ), but never used +function multiply defined msg_003_a.c(10) :: msg_003_b.c(10) Index: src/tests/usr.bin/xlint/lint2/msg_003.ln diff -u src/tests/usr.bin/xlint/lint2/msg_003.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_003.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_003.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_003.ln Sat Aug 7 19:07:03 2021 @@ -1,6 +1,14 @@ -# $NetBSD: msg_003.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_003.ln,v 1.2 2021/08/07 19:07:03 rillig Exp $ # # Test data for message 3 of lint2: # %s multiply defined %s :: %s -# -# TODO: add actual test data + +0smsg_003_a.c +Smsg_003_a.c +# msg_003_a.c:10: int function(void); +10d0.10d8functionF0I + +0smsg_003_b.c +Smsg_003_b.c +# msg_003_b.c:10: int function(void); +10d0.10d8functionF0I Index: src/tests/usr.bin/xlint/lint2/msg_004.exp diff -u src/tests/usr.bin/xlint/lint2/msg_004.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_004.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_004.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_004.exp Sat Aug 7 19:07:03 2021 @@ -0,0 +1,6 @@ +add value used inconsistently msg_004_define.c(2) :: msg_004_call.c(4) +add value declared inconsistently (double != int) msg_004_define.c(2) :: msg_004_call.c(2) +add, arg 1 used inconsistently msg_004_define.c(2)[double] :: msg_004_call.c(4)[int] +add, arg 2 used inconsistently msg_004_define.c(2)[double] :: msg_004_call.c(4)[int] +add, arg 1 declared inconsistently (double != int) msg_004_define.c(2) :: msg_004_call.c(2) +add, arg 2 declared inconsistently (double != int) msg_004_define.c(2) :: msg_004_call.c(2) Index: src/tests/usr.bin/xlint/lint2/msg_004.ln diff -u src/tests/usr.bin/xlint/lint2/msg_004.ln:1.1
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Sat Aug 7 19:07:03 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_001.exp msg_001.ln msg_003.exp msg_003.ln msg_004.exp msg_004.ln msg_005.exp msg_005.ln msg_006.exp msg_006.ln msg_011.exp msg_011.ln msg_012.exp msg_012.ln Log Message: tests/lint: add more tests for lint2 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint2/msg_001.exp \ src/tests/usr.bin/xlint/lint2/msg_001.ln cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_003.exp \ src/tests/usr.bin/xlint/lint2/msg_003.ln \ src/tests/usr.bin/xlint/lint2/msg_004.exp \ src/tests/usr.bin/xlint/lint2/msg_004.ln \ src/tests/usr.bin/xlint/lint2/msg_005.exp \ src/tests/usr.bin/xlint/lint2/msg_005.ln \ src/tests/usr.bin/xlint/lint2/msg_006.exp \ src/tests/usr.bin/xlint/lint2/msg_006.ln \ src/tests/usr.bin/xlint/lint2/msg_011.exp \ src/tests/usr.bin/xlint/lint2/msg_011.ln \ src/tests/usr.bin/xlint/lint2/msg_012.exp \ src/tests/usr.bin/xlint/lint2/msg_012.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Fri Aug 6 16:21:00 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_001.exp msg_001.ln msg_002.exp msg_002.ln Log Message: tests/lint: add tests for declared but unused variables To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_001.exp \ src/tests/usr.bin/xlint/lint2/msg_001.ln \ src/tests/usr.bin/xlint/lint2/msg_002.exp \ src/tests/usr.bin/xlint/lint2/msg_002.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint2/msg_001.exp diff -u src/tests/usr.bin/xlint/lint2/msg_001.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_001.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_001.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_001.exp Fri Aug 6 16:21:00 2021 @@ -0,0 +1,2 @@ +defined_not_used defined( msg_000.c(2) ), but never used +used_not_defined used( msg_000.c(3) ), but not defined Index: src/tests/usr.bin/xlint/lint2/msg_001.ln diff -u src/tests/usr.bin/xlint/lint2/msg_001.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_001.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_001.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_001.ln Fri Aug 6 16:21:00 2021 @@ -1,6 +1,11 @@ -# $NetBSD: msg_001.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_001.ln,v 1.2 2021/08/06 16:21:00 rillig Exp $ # # Test data for message 1 of lint2: # %s defined( %s ), but never used # -# TODO: add actual test data + +0smsg_000.c +Smsg_000.c + +3c0.3p1i16used_not_definedf2IDI +2d0.2do16defined_not_usedf0I Index: src/tests/usr.bin/xlint/lint2/msg_002.exp diff -u src/tests/usr.bin/xlint/lint2/msg_002.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_002.exp:1.2 --- src/tests/usr.bin/xlint/lint2/msg_002.exp:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_002.exp Fri Aug 6 16:21:00 2021 @@ -0,0 +1,2 @@ +defined defined( msg_002.c(3) ), but never used +only_declared declared( msg_002.c(2) ), but never used or defined Index: src/tests/usr.bin/xlint/lint2/msg_002.ln diff -u src/tests/usr.bin/xlint/lint2/msg_002.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_002.ln:1.2 --- src/tests/usr.bin/xlint/lint2/msg_002.ln:1.1 Thu Aug 5 22:36:08 2021 +++ src/tests/usr.bin/xlint/lint2/msg_002.ln Fri Aug 6 16:21:00 2021 @@ -1,6 +1,14 @@ -# $NetBSD: msg_002.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $ +# $NetBSD: msg_002.ln,v 1.2 2021/08/06 16:21:00 rillig Exp $ # # Test data for message 2 of lint2: # %s declared( %s ), but never used or defined # -# TODO: add actual test data + +0smsg_002.c +Smsg_002.c + +# extern int only_declared; +2d0.2e13only_declaredI + +# int defined; +3d0.3t7definedI
CVS commit: src/tests/usr.bin/xlint/lint2
Module Name:src Committed By: rillig Date: Fri Aug 6 16:21:00 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint2: msg_001.exp msg_001.ln msg_002.exp msg_002.ln Log Message: tests/lint: add tests for declared but unused variables To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_001.exp \ src/tests/usr.bin/xlint/lint2/msg_001.ln \ src/tests/usr.bin/xlint/lint2/msg_002.exp \ src/tests/usr.bin/xlint/lint2/msg_002.ln Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.