Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src tests/lint: cover every code line in the grammar
details: https://anonhg.NetBSD.org/src/rev/5cb43b40cda5
branches: trunk
changeset: 984858:5cb43b40cda5
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jul 25 22:03:42 2021 +0000
description:
tests/lint: cover every code line in the grammar
diffstat:
distrib/sets/lists/tests/mi | 4 +++-
tests/usr.bin/xlint/lint1/Makefile | 4 +++-
tests/usr.bin/xlint/lint1/c90.c | 12 ++++++++++++
tests/usr.bin/xlint/lint1/c90.exp | 1 +
tests/usr.bin/xlint/lint1/decl.c | 8 +++++++-
tests/usr.bin/xlint/lint1/decl.exp | 1 +
tests/usr.bin/xlint/lint1/parse_init_declarator.c | 5 ++++-
tests/usr.bin/xlint/lint1/parse_type_name.c | 4 ++--
8 files changed, 33 insertions(+), 6 deletions(-)
diffs (118 lines):
diff -r 47cae93bbbe1 -r 5cb43b40cda5 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sun Jul 25 21:31:01 2021 +0000
+++ b/distrib/sets/lists/tests/mi Sun Jul 25 22:03:42 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1095 2021/07/25 17:27:07 rillig Exp $
+# $NetBSD: mi,v 1.1096 2021/07/25 22:03:42 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -6116,6 +6116,8 @@
./usr/tests/usr.bin/xlint/lint1/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua
./usr/tests/usr.bin/xlint/lint1/c11_generic_expression.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/c11_generic_expression.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/c90.c tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/c90.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.exp tests-obsolete obsolete
./usr/tests/usr.bin/xlint/lint1/c99_init_array.c tests-usr.bin-tests compattestfile,atf
diff -r 47cae93bbbe1 -r 5cb43b40cda5 tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile Sun Jul 25 21:31:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile Sun Jul 25 22:03:42 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.96 2021/07/25 17:27:07 rillig Exp $
+# $NetBSD: Makefile,v 1.97 2021/07/25 22:03:42 rillig Exp $
NOMAN= # defined
MAX_MESSAGE= 345 # see lint1/err.c
@@ -18,6 +18,8 @@
FILESDIR= ${TESTSDIR}
FILES+= c11_generic_expression.c
FILES+= c11_generic_expression.exp
+FILES+= c90.c
+FILES+= c90.exp
FILES+= c99_bool_strict_suppressed.c
FILES+= c99_init_array.c
FILES+= c99_init_array.exp
diff -r 47cae93bbbe1 -r 5cb43b40cda5 tests/usr.bin/xlint/lint1/c90.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/c90.c Sun Jul 25 22:03:42 2021 +0000
@@ -0,0 +1,12 @@
+/* $NetBSD: c90.c,v 1.1 2021/07/25 22:03:42 rillig Exp $ */
+# 3 "c90.c"
+
+/*
+ * Tests for the option -s, which allows features from C90, but neither any
+ * later C standards nor GNU extensions.
+ */
+
+/* lint1-flags: -sw */
+
+/* expect+1: error: ANSI C requires formal parameter before '...' [84] */
+void varargs_function(...);
diff -r 47cae93bbbe1 -r 5cb43b40cda5 tests/usr.bin/xlint/lint1/c90.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/c90.exp Sun Jul 25 22:03:42 2021 +0000
@@ -0,0 +1,1 @@
+c90.c(12): error: ANSI C requires formal parameter before '...' [84]
diff -r 47cae93bbbe1 -r 5cb43b40cda5 tests/usr.bin/xlint/lint1/decl.c
--- a/tests/usr.bin/xlint/lint1/decl.c Sun Jul 25 21:31:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl.c Sun Jul 25 22:03:42 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.11 2021/07/25 08:42:28 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.12 2021/07/25 22:03:42 rillig Exp $ */
# 3 "decl.c"
/*
@@ -164,3 +164,9 @@
__thread int thread_int;
/* expect+1: syntax error 'int' [249] */
__thread__ int thread_int;
+
+/* expect+2: warning: static function cover_func_declarator unused [236] */
+static
+cover_func_declarator(void)
+{
+}
diff -r 47cae93bbbe1 -r 5cb43b40cda5 tests/usr.bin/xlint/lint1/decl.exp
--- a/tests/usr.bin/xlint/lint1/decl.exp Sun Jul 25 21:31:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl.exp Sun Jul 25 22:03:42 2021 +0000
@@ -12,3 +12,4 @@
decl.c(163): error: syntax error 'int' [249]
decl.c(166): error: syntax error 'int' [249]
decl.c(114): warning: static function unused unused [236]
+decl.c(170): warning: static function cover_func_declarator unused [236]
diff -r 47cae93bbbe1 -r 5cb43b40cda5 tests/usr.bin/xlint/lint1/parse_init_declarator.c
--- a/tests/usr.bin/xlint/lint1/parse_init_declarator.c Sun Jul 25 21:31:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/parse_init_declarator.c Sun Jul 25 22:03:42 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse_init_declarator.c,v 1.2 2021/07/25 17:40:04 rillig Exp $ */
+/* $NetBSD: parse_init_declarator.c,v 1.3 2021/07/25 22:03:42 rillig Exp $ */
# 3 "parse_init_declarator.c"
/*
@@ -28,3 +28,6 @@
int *init_declarator_with_initializer_attribute_too_late
__asm("") = &global_var __attribute__((deprecated));
/* expect-1: error: syntax error '__attribute__' [249] */
+
+/* cover cgram_declare, freeyyv */
+int original __symbolrename(renamed);
diff -r 47cae93bbbe1 -r 5cb43b40cda5 tests/usr.bin/xlint/lint1/parse_type_name.c
--- a/tests/usr.bin/xlint/lint1/parse_type_name.c Sun Jul 25 21:31:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/parse_type_name.c Sun Jul 25 22:03:42 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse_type_name.c,v 1.6 2021/07/25 19:41:33 rillig Exp $ */
+/* $NetBSD: parse_type_name.c,v 1.7 2021/07/25 22:03:42 rillig Exp $ */
# 3 "parse_type_name.c"
/*
@@ -65,7 +65,7 @@
sink(sizeof(int[3]));
/* cover 'type_attribute direct_abstract_declarator' */
- /* TODO */
+ sink(sizeof(int *__attribute__(())[3]));
/* cover 'direct_abstract_declarator T_LBRACK T_RBRACK' */
/* expect+1: error: null dimension [17] */
Home |
Main Index |
Thread Index |
Old Index