Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src tests/lint: merge tests for declaration after statement



details:   https://anonhg.NetBSD.org/src/rev/700bee992d94
branches:  trunk
changeset: 373163:700bee992d94
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 22 17:17:24 2023 +0000

description:
tests/lint: merge tests for declaration after statement

diffstat:

 distrib/sets/lists/tests/mi                         |   6 ++--
 tests/usr.bin/xlint/lint1/Makefile                  |   4 +--
 tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c  |  27 +++++++++++++++++++-
 tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c |  23 -----------------
 tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c |  18 --------------
 5 files changed, 29 insertions(+), 49 deletions(-)

diffs (132 lines):

diff -r e3830bad9f47 -r 700bee992d94 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sun Jan 22 17:04:30 2023 +0000
+++ b/distrib/sets/lists/tests/mi       Sun Jan 22 17:17:24 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1246 2023/01/21 13:07:21 rillig Exp $
+# $NetBSD: mi,v 1.1247 2023/01/22 17:17:24 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6442,8 +6442,8 @@
 ./usr/tests/usr.bin/xlint/lint1/d_c99_complex_split.exp                tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c       tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c      tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c      tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c      tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c      tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c      tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_for_loops.c              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_func.c                   tests-usr.bin-tests     compattestfile,atf
diff -r e3830bad9f47 -r 700bee992d94 tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Sun Jan 22 17:04:30 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Sun Jan 22 17:17:24 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.133 2023/01/21 13:07:22 rillig Exp $
+# $NetBSD: Makefile,v 1.134 2023/01/22 17:17:25 rillig Exp $
 
 NOMAN=         # defined
 MAX_MESSAGE=   350             # see lint1/err.c
@@ -36,8 +36,6 @@
 FILES+=                d_c99_complex_split.c
 FILES+=                d_c99_compound_literal_comma.c
 FILES+=                d_c99_decls_after_stmt.c
-FILES+=                d_c99_decls_after_stmt2.c
-FILES+=                d_c99_decls_after_stmt3.c
 FILES+=                d_c99_flex_array_packed.c
 FILES+=                d_c99_for_loops.c
 FILES+=                d_c99_func.c
diff -r e3830bad9f47 -r 700bee992d94 tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c
--- a/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c        Sun Jan 22 17:04:30 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt.c        Sun Jan 22 17:17:24 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_decls_after_stmt.c,v 1.4 2022/02/12 01:23:44 rillig Exp $        */
+/*     $NetBSD: d_c99_decls_after_stmt.c,v 1.5 2023/01/22 17:17:25 rillig Exp $        */
 # 3 "d_c99_decls_after_stmt.c"
 
 /*
@@ -9,7 +9,7 @@
  */
 
 void
-sample(void)
+two_groups_of_decl_plus_stmt(void)
 {
        int i = 0;
        i += 1;
@@ -17,3 +17,26 @@
        int j = 0;
        j += 1;
 }
+
+typedef int int_t;
+
+int
+second_decl_stmt_uses_a_typedef(void)
+{
+       int i = 0;
+       i += 1;
+
+       int_t j = 0;
+       j += 1;
+
+       return 0;
+}
+
+void
+function_with_argument(int i)
+{
+       i += 1;
+
+       int j = 0;
+       j += 1;
+}
diff -r e3830bad9f47 -r 700bee992d94 tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c
--- a/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt2.c       Sun Jan 22 17:04:30 2023 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*     $NetBSD: d_c99_decls_after_stmt2.c,v 1.4 2022/02/12 01:23:44 rillig Exp $       */
-# 3 "d_c99_decls_after_stmt2.c"
-
-/*
- * Before cgram.y 1.50 from 2011-10-04, lint complained about syntax errors
- * at the second 'int'.
- *
- * https://gnats.netbsd.org/45417
- */
-
-typedef int int_t;
-
-int
-main(void)
-{
-       int i = 0;
-       i += 1;
-
-       int_t j = 0;
-       j += 1;
-
-       return 0;
-}
diff -r e3830bad9f47 -r 700bee992d94 tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c
--- a/tests/usr.bin/xlint/lint1/d_c99_decls_after_stmt3.c       Sun Jan 22 17:04:30 2023 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*     $NetBSD: d_c99_decls_after_stmt3.c,v 1.4 2022/02/12 01:23:44 rillig Exp $       */
-# 3 "d_c99_decls_after_stmt3.c"
-
-/*
- * Before cgram.y 1.50 from 2011-10-04, lint complained about syntax errors
- * at the second 'int'.
- *
- * https://gnats.netbsd.org/45417
- */
-
-void
-sample(int i)
-{
-       i += 1;
-
-       int j = 0;
-       j += 1;
-}



Home | Main Index | Thread Index | Old Index