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 context 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,4 +1,4 @@
-# $NetBSD: mi,v 1.1034 2021/03/28 14:01:49 rillig Exp $
+# $NetBSD: mi,v 1.1035 2021/04/02 17:25:04 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6861,6 +6861,8 @@
 ./usr/tests/usr.bin/xlint/lint1/msg_339.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_340.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_340.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/op_colon.c			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/op_colon.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/t_integration			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/ztest				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/ztest/Atffile			tests-usr.bin-tests	compattestfile,atf

cvs diff -r1.37 -r1.38 src/tests/usr.bin/xlint/lint1/Makefile (expand / switch to context 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,4 +1,4 @@
-# $NetBSD: Makefile,v 1.37 2021/03/28 14:01:50 rillig Exp $
+# $NetBSD: Makefile,v 1.38 2021/04/02 17:25:04 rillig Exp $
 
 NOMAN=		# defined
 
@@ -99,6 +99,8 @@
 FILES+=		d_typename_as_var.c
 FILES+=		d_zero_sized_arrays.c
 FILES+=		${:U0 ${:U:range=340}:C,^.$,0&,:C,^..$,0&,:@msg@msg_${msg}.c msg_${msg}.exp@:Nmsg_176.exp}
+FILES+=		op_colon.c
+FILES+=		op_colon.exp
 
 # Note: only works for adding tests.
 # To remove a test, the $$mi file must be edited manually.

cvs diff -r1.37 -r1.38 src/tests/usr.bin/xlint/lint1/t_integration.sh (expand / switch to context 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,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.37 2021/03/28 14:01:50 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.38 2021/04/02 17:25:04 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -165,6 +165,8 @@
 test_case d_type_conv3
 test_case d_incorrect_array_size
 test_case d_long_double_int
+
+test_case op_colon
 
 test_case all_messages
 all_messages_body()

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]