Fri Apr 2 17:25:04 2021 UTC ()
tests/lint: prevent typo from tree.c 1.264 from happening again


(rillig)
diff -r1.1034 -r1.1035 src/distrib/sets/lists/tests/mi
diff -r1.37 -r1.38 src/tests/usr.bin/xlint/lint1/Makefile
diff -r1.37 -r1.38 src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -r0 -r1.1 src/tests/usr.bin/xlint/lint1/op_colon.c
diff -r0 -r1.1 src/tests/usr.bin/xlint/lint1/op_colon.exp

cvs diff -r1.1034 -r1.1035 src/distrib/sets/lists/tests/mi (expand / switch to unified diff)

--- src/distrib/sets/lists/tests/mi 2021/03/28 14:01:49 1.1034
+++ src/distrib/sets/lists/tests/mi 2021/04/02 17:25:04 1.1035
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: mi,v 1.1034 2021/03/28 14:01:49 rillig Exp $ 1# $NetBSD: mi,v 1.1035 2021/04/02 17:25:04 rillig Exp $
2# 2#
3# Note: don't delete entries from here - mark them as "obsolete" instead. 3# Note: don't delete entries from here - mark them as "obsolete" instead.
4# 4#
5./etc/mtree/set.tests tests-sys-root 5./etc/mtree/set.tests tests-sys-root
6./usr/libdata/debug/usr/tests tests-base-debug compattestdir 6./usr/libdata/debug/usr/tests tests-base-debug compattestdir
7./usr/libdata/debug/usr/tests/atf tests-atf-debug compattestfile,atf 7./usr/libdata/debug/usr/tests/atf tests-atf-debug compattestfile,atf
8./usr/libdata/debug/usr/tests/atf/atf-c tests-atf-debug compattestfile,atf 8./usr/libdata/debug/usr/tests/atf/atf-c tests-atf-debug compattestfile,atf
9./usr/libdata/debug/usr/tests/atf/atf-c++ tests-atf-debug compattestfile,atf 9./usr/libdata/debug/usr/tests/atf/atf-c++ tests-atf-debug compattestfile,atf
10./usr/libdata/debug/usr/tests/atf/atf-c++/detail tests-atf-debug compattestfile,atf 10./usr/libdata/debug/usr/tests/atf/atf-c++/detail tests-atf-debug compattestfile,atf
11./usr/libdata/debug/usr/tests/atf/atf-c/detail tests-atf-debug compattestfile,atf 11./usr/libdata/debug/usr/tests/atf/atf-c/detail tests-atf-debug compattestfile,atf
12./usr/libdata/debug/usr/tests/atf/atf-compile tests-obsolete obsolete 12./usr/libdata/debug/usr/tests/atf/atf-compile tests-obsolete obsolete
13./usr/libdata/debug/usr/tests/atf/atf-report tests-obsolete obsolete 13./usr/libdata/debug/usr/tests/atf/atf-report tests-obsolete obsolete
14./usr/libdata/debug/usr/tests/atf/atf-run tests-obsolete obsolete 14./usr/libdata/debug/usr/tests/atf/atf-run tests-obsolete obsolete
@@ -6851,26 +6851,28 @@ @@ -6851,26 +6851,28 @@
6851./usr/tests/usr.bin/xlint/lint1/msg_334.exp tests-usr.bin-tests compattestfile,atf 6851./usr/tests/usr.bin/xlint/lint1/msg_334.exp tests-usr.bin-tests compattestfile,atf
6852./usr/tests/usr.bin/xlint/lint1/msg_335.c tests-usr.bin-tests compattestfile,atf 6852./usr/tests/usr.bin/xlint/lint1/msg_335.c tests-usr.bin-tests compattestfile,atf
6853./usr/tests/usr.bin/xlint/lint1/msg_335.exp tests-usr.bin-tests compattestfile,atf 6853./usr/tests/usr.bin/xlint/lint1/msg_335.exp tests-usr.bin-tests compattestfile,atf
6854./usr/tests/usr.bin/xlint/lint1/msg_336.c tests-usr.bin-tests compattestfile,atf 6854./usr/tests/usr.bin/xlint/lint1/msg_336.c tests-usr.bin-tests compattestfile,atf
6855./usr/tests/usr.bin/xlint/lint1/msg_336.exp tests-usr.bin-tests compattestfile,atf 6855./usr/tests/usr.bin/xlint/lint1/msg_336.exp tests-usr.bin-tests compattestfile,atf
6856./usr/tests/usr.bin/xlint/lint1/msg_337.c tests-usr.bin-tests compattestfile,atf 6856./usr/tests/usr.bin/xlint/lint1/msg_337.c tests-usr.bin-tests compattestfile,atf
6857./usr/tests/usr.bin/xlint/lint1/msg_337.exp tests-usr.bin-tests compattestfile,atf 6857./usr/tests/usr.bin/xlint/lint1/msg_337.exp tests-usr.bin-tests compattestfile,atf
6858./usr/tests/usr.bin/xlint/lint1/msg_338.c tests-usr.bin-tests compattestfile,atf 6858./usr/tests/usr.bin/xlint/lint1/msg_338.c tests-usr.bin-tests compattestfile,atf
6859./usr/tests/usr.bin/xlint/lint1/msg_338.exp tests-usr.bin-tests compattestfile,atf 6859./usr/tests/usr.bin/xlint/lint1/msg_338.exp tests-usr.bin-tests compattestfile,atf
6860./usr/tests/usr.bin/xlint/lint1/msg_339.c tests-usr.bin-tests compattestfile,atf 6860./usr/tests/usr.bin/xlint/lint1/msg_339.c tests-usr.bin-tests compattestfile,atf
6861./usr/tests/usr.bin/xlint/lint1/msg_339.exp tests-usr.bin-tests compattestfile,atf 6861./usr/tests/usr.bin/xlint/lint1/msg_339.exp tests-usr.bin-tests compattestfile,atf
6862./usr/tests/usr.bin/xlint/lint1/msg_340.c tests-usr.bin-tests compattestfile,atf 6862./usr/tests/usr.bin/xlint/lint1/msg_340.c tests-usr.bin-tests compattestfile,atf
6863./usr/tests/usr.bin/xlint/lint1/msg_340.exp tests-usr.bin-tests compattestfile,atf 6863./usr/tests/usr.bin/xlint/lint1/msg_340.exp tests-usr.bin-tests compattestfile,atf
 6864./usr/tests/usr.bin/xlint/lint1/op_colon.c tests-usr.bin-tests compattestfile,atf
 6865./usr/tests/usr.bin/xlint/lint1/op_colon.exp tests-usr.bin-tests compattestfile,atf
6864./usr/tests/usr.bin/xlint/lint1/t_integration tests-usr.bin-tests compattestfile,atf 6866./usr/tests/usr.bin/xlint/lint1/t_integration tests-usr.bin-tests compattestfile,atf
6865./usr/tests/usr.bin/ztest tests-usr.bin-tests compattestfile,atf 6867./usr/tests/usr.bin/ztest tests-usr.bin-tests compattestfile,atf
6866./usr/tests/usr.bin/ztest/Atffile tests-usr.bin-tests compattestfile,atf 6868./usr/tests/usr.bin/ztest/Atffile tests-usr.bin-tests compattestfile,atf
6867./usr/tests/usr.bin/ztest/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua 6869./usr/tests/usr.bin/ztest/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua
6868./usr/tests/usr.bin/ztest/t_ztest tests-usr.bin-tests compattestfile,atf 6870./usr/tests/usr.bin/ztest/t_ztest tests-usr.bin-tests compattestfile,atf
6869./usr/tests/usr.sbin tests-usr.sbin-tests compattestfile,atf 6871./usr/tests/usr.sbin tests-usr.sbin-tests compattestfile,atf
6870./usr/tests/usr.sbin/Atffile tests-usr.sbin-tests compattestfile,atf 6872./usr/tests/usr.sbin/Atffile tests-usr.sbin-tests compattestfile,atf
6871./usr/tests/usr.sbin/Kyuafile tests-usr.sbin-tests compattestfile,atf,kyua 6873./usr/tests/usr.sbin/Kyuafile tests-usr.sbin-tests compattestfile,atf,kyua
6872./usr/tests/usr.sbin/cpuctl tests-usr.sbin-tests compattestfile,atf 6874./usr/tests/usr.sbin/cpuctl tests-usr.sbin-tests compattestfile,atf
6873./usr/tests/usr.sbin/cpuctl/Atffile tests-usr.sbin-tests compattestfile,atf 6875./usr/tests/usr.sbin/cpuctl/Atffile tests-usr.sbin-tests compattestfile,atf
6874./usr/tests/usr.sbin/cpuctl/Kyuafile tests-usr.sbin-tests compattestfile,atf,kyua 6876./usr/tests/usr.sbin/cpuctl/Kyuafile tests-usr.sbin-tests compattestfile,atf,kyua
6875./usr/tests/usr.sbin/cpuctl/t_cpuctl tests-usr.sbin-tests compattestfile,atf 6877./usr/tests/usr.sbin/cpuctl/t_cpuctl tests-usr.sbin-tests compattestfile,atf
6876./usr/tests/usr.sbin/execsnoop tests-usr.sbin-tests compattestfile,atf 6878./usr/tests/usr.sbin/execsnoop tests-usr.sbin-tests compattestfile,atf

cvs diff -r1.37 -r1.38 src/tests/usr.bin/xlint/lint1/Makefile (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/Makefile 2021/03/28 14:01:50 1.37
+++ src/tests/usr.bin/xlint/lint1/Makefile 2021/04/02 17:25:04 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.37 2021/03/28 14:01:50 rillig Exp $ 1# $NetBSD: Makefile,v 1.38 2021/04/02 17:25:04 rillig Exp $
2 2
3NOMAN= # defined 3NOMAN= # defined
4 4
5.include <bsd.own.mk> 5.include <bsd.own.mk>
6 6
7TESTSDIR= ${TESTSBASE}/usr.bin/xlint/lint1 7TESTSDIR= ${TESTSBASE}/usr.bin/xlint/lint1
8 8
9TESTS_SH= t_integration 9TESTS_SH= t_integration
10 10
11FILESDIR= ${TESTSDIR} 11FILESDIR= ${TESTSDIR}
12FILES+= d_alignof.c 12FILES+= d_alignof.c
13FILES+= d_bltinoffsetof.c 13FILES+= d_bltinoffsetof.c
14FILES+= d_c99_bool.c 14FILES+= d_c99_bool.c
@@ -89,26 +89,28 @@ FILES+= d_shift_to_narrower_type.c @@ -89,26 +89,28 @@ FILES+= d_shift_to_narrower_type.c
89FILES+= d_struct_init_nested.c 89FILES+= d_struct_init_nested.c
90FILES+= d_struct_init_nested.exp 90FILES+= d_struct_init_nested.exp
91FILES+= d_type_conv1.c 91FILES+= d_type_conv1.c
92FILES+= d_type_conv1.exp 92FILES+= d_type_conv1.exp
93FILES+= d_type_conv2.c 93FILES+= d_type_conv2.c
94FILES+= d_type_conv2.exp 94FILES+= d_type_conv2.exp
95FILES+= d_type_conv3.c 95FILES+= d_type_conv3.c
96FILES+= d_type_conv3.exp 96FILES+= d_type_conv3.exp
97FILES+= d_type_question_colon.c 97FILES+= d_type_question_colon.c
98FILES+= d_typefun.c 98FILES+= d_typefun.c
99FILES+= d_typename_as_var.c 99FILES+= d_typename_as_var.c
100FILES+= d_zero_sized_arrays.c 100FILES+= d_zero_sized_arrays.c
101FILES+= ${:U0 ${:U:range=340}:C,^.$,0&,:C,^..$,0&,:@msg@msg_${msg}.c msg_${msg}.exp@:Nmsg_176.exp} 101FILES+= ${:U0 ${:U:range=340}:C,^.$,0&,:C,^..$,0&,:@msg@msg_${msg}.c msg_${msg}.exp@:Nmsg_176.exp}
 102FILES+= op_colon.c
 103FILES+= op_colon.exp
102 104
103# Note: only works for adding tests. 105# Note: only works for adding tests.
104# To remove a test, the $$mi file must be edited manually. 106# To remove a test, the $$mi file must be edited manually.
105sync-mi: .PHONY 107sync-mi: .PHONY
106 @set -eu; \ 108 @set -eu; \
107 cd "${MAKEFILE:tA:H}/../../../.."; \ 109 cd "${MAKEFILE:tA:H}/../../../.."; \
108 mi="distrib/sets/lists/tests/mi"; \ 110 mi="distrib/sets/lists/tests/mi"; \
109 cvs update "$$mi"; \ 111 cvs update "$$mi"; \
110 fmt="./usr/tests/usr.bin/xlint/lint1/%s\ttests-usr.bin-tests\tcompattestfile,atf\n"; \ 112 fmt="./usr/tests/usr.bin/xlint/lint1/%s\ttests-usr.bin-tests\tcompattestfile,atf\n"; \
111 cat "$$mi" > "$$mi.tmp"; \ 113 cat "$$mi" > "$$mi.tmp"; \
112 printf "$$fmt" ${FILES:M*.c} ${FILES:M*.exp} >> "$$mi.tmp"; \ 114 printf "$$fmt" ${FILES:M*.c} ${FILES:M*.exp} >> "$$mi.tmp"; \
113 distrib/sets/fmt-list "$$mi.tmp"; \ 115 distrib/sets/fmt-list "$$mi.tmp"; \
114 mv "$$mi.tmp" "$$mi"; \ 116 mv "$$mi.tmp" "$$mi"; \

cvs diff -r1.37 -r1.38 src/tests/usr.bin/xlint/lint1/t_integration.sh (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/t_integration.sh 2021/03/28 14:01:50 1.37
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh 2021/04/02 17:25:04 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: t_integration.sh,v 1.37 2021/03/28 14:01:50 rillig Exp $ 1# $NetBSD: t_integration.sh,v 1.38 2021/04/02 17:25:04 rillig Exp $
2# 2#
3# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. 3# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
8# are met: 8# are met:
9# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.
14# 14#
@@ -156,26 +156,28 @@ test_case d_ellipsis_in_switch @@ -156,26 +156,28 @@ test_case d_ellipsis_in_switch
156test_case d_c99_complex_num 156test_case d_c99_complex_num
157test_case d_c99_complex_split 157test_case d_c99_complex_split
158test_case d_c99_for_loops 158test_case d_c99_for_loops
159test_case d_alignof 159test_case d_alignof
160test_case d_shift_to_narrower_type 160test_case d_shift_to_narrower_type
161test_case d_constant_conv1 161test_case d_constant_conv1
162test_case d_constant_conv2 162test_case d_constant_conv2
163test_case d_type_conv1 163test_case d_type_conv1
164test_case d_type_conv2 164test_case d_type_conv2
165test_case d_type_conv3 165test_case d_type_conv3
166test_case d_incorrect_array_size 166test_case d_incorrect_array_size
167test_case d_long_double_int 167test_case d_long_double_int
168 168
 169test_case op_colon
 170
169test_case all_messages 171test_case all_messages
170all_messages_body() 172all_messages_body()
171{ 173{
172 local failed msg 174 local failed msg
173 175
174 failed="" 176 failed=""
175 177
176 for msg in $(seq 0 340); do 178 for msg in $(seq 0 340); do
177 name="$(printf 'msg_%03d.c' "${msg}")" 179 name="$(printf 'msg_%03d.c' "${msg}")"
178 check_lint1 "${name}" \ 180 check_lint1 "${name}" \
179 || failed="$failed${failed:+ }$name" 181 || failed="$failed${failed:+ }$name"
180 done 182 done
181 183

File Added: src/tests/usr.bin/xlint/lint1/op_colon.c
/*	$NetBSD: op_colon.c,v 1.1 2021/04/02 17:25:04 rillig Exp $	*/
# 3 "op_colon.c"

/*
 * Test handling of the operator ':', as part of the '?:'.
 */

/* lint1-extra-flags: -p */

void sink(void *);

void
test_merge_qualifiers(_Bool cond, int *p, const int *c, volatile int *v,
		      const volatile int *cv)
{
	sink(cond ? p : p);
	sink(cond ? p : c);	/* expect: 'pointer to const int' */
	sink(cond ? p : v);	/* expect: 'pointer to volatile int' */
	sink(cond ? p : cv);	/* expect: 'pointer to const volatile int' */

	sink(cond ? c : p);	/* expect: 'pointer to const int' */
	sink(cond ? c : c);	/* expect: 'pointer to const int' */
	sink(cond ? c : v);	/* expect: 'pointer to const volatile int' */
	sink(cond ? c : cv);	/* expect: 'pointer to const volatile int' */

	sink(cond ? v : p);	/* expect: 'pointer to volatile int' */
	sink(cond ? v : c);	/* expect: 'pointer to const volatile int' */
	sink(cond ? v : v);	/* expect: 'pointer to volatile int' */
	sink(cond ? v : cv);	/* expect: 'pointer to const volatile int' */

	sink(cond ? cv : p);	/* expect: 'pointer to const volatile int' */
	sink(cond ? cv : c);	/* expect: 'pointer to const volatile int' */
	sink(cond ? cv : v);	/* expect: 'pointer to const volatile int' */
	sink(cond ? cv : cv);	/* expect: 'pointer to const volatile int' */
}

File Added: src/tests/usr.bin/xlint/lint1/Attic/op_colon.exp
op_colon.c(17): warning: converting 'pointer to const int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(18): warning: converting 'pointer to volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(19): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(21): warning: converting 'pointer to const int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(22): warning: converting 'pointer to const int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(23): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(24): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(26): warning: converting 'pointer to volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(27): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(28): warning: converting 'pointer to volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(29): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(31): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(32): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(33): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]
op_colon.c(34): warning: converting 'pointer to const volatile int' to incompatible 'pointer to void' for argument 1 [153]