Source-Changes-HG archive

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

[src/trunk]: src tests/lint: test line number tracking with \v and \f



details:   https://anonhg.NetBSD.org/src/rev/ed21ad08159c
branches:  trunk
changeset: 1023480:ed21ad08159c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Sep 10 19:40:18 2021 +0000

description:
tests/lint: test line number tracking with \v and \f

diffstat:

 distrib/sets/lists/tests/mi                  |   4 +++-
 tests/usr.bin/xlint/lint1/Makefile           |   4 +++-
 tests/usr.bin/xlint/lint1/lex_whitespace.c   |  25 +++++++++++++++++++++++++
 tests/usr.bin/xlint/lint1/lex_whitespace.exp |   4 ++++
 4 files changed, 35 insertions(+), 2 deletions(-)

diffs (73 lines):

diff -r 11f7bc39eaa6 -r ed21ad08159c distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Fri Sep 10 18:51:36 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Fri Sep 10 19:40:18 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1122 2021/09/03 22:44:08 rillig Exp $
+# $NetBSD: mi,v 1.1123 2021/09/10 19:40:18 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6314,6 +6314,8 @@
 ./usr/tests/usr.bin/xlint/lint1/lex_integer_ilp32.exp          tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/lex_string.c                   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/lex_string.exp                 tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/lex_whitespace.c               tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/lex_whitespace.exp             tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/lex_wide_char.c                        tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/lex_wide_char.exp              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/lex_wide_string.c              tests-usr.bin-tests     compattestfile,atf
diff -r 11f7bc39eaa6 -r ed21ad08159c tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Fri Sep 10 18:51:36 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Fri Sep 10 19:40:18 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.109 2021/09/03 22:44:09 rillig Exp $
+# $NetBSD: Makefile,v 1.110 2021/09/10 19:40:18 rillig Exp $
 
 NOMAN=         # defined
 MAX_MESSAGE=   346             # see lint1/err.c
@@ -203,6 +203,8 @@
 FILES+=                lex_integer_ilp32.exp
 FILES+=                lex_string.c
 FILES+=                lex_string.exp
+FILES+=                lex_whitespace.c
+FILES+=                lex_whitespace.exp
 FILES+=                lex_wide_char.c
 FILES+=                lex_wide_char.exp
 FILES+=                lex_wide_string.c
diff -r 11f7bc39eaa6 -r ed21ad08159c tests/usr.bin/xlint/lint1/lex_whitespace.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/lex_whitespace.c        Fri Sep 10 19:40:18 2021 +0000
@@ -0,0 +1,25 @@
+/*     $NetBSD: lex_whitespace.c,v 1.1 2021/09/10 19:40:18 rillig Exp $        */
+# 3 "lex_whitespace.c"
+
+/*
+ * Test tracking of the current position in the translation unit, with
+ * spaces, tabs, vertical tabs and form feeds.
+ *
+ * Both vertical tab and form feed do not increment the line number.
+ * Lint agrees with GCC and Clang here.
+ */
+
+/* expect+1: warning: typedef declares no type name [72] */
+typedef;
+
+       /* horizontal tab */
+/* expect+1: warning: typedef declares no type name [72] */
+typedef;
+
+/* vertical tab */
+/* expect+1: warning: typedef declares no type name [72] */
+typedef;
+
+/* form feed */
+/* expect+1: warning: typedef declares no type name [72] */
+typedef;
diff -r 11f7bc39eaa6 -r ed21ad08159c tests/usr.bin/xlint/lint1/lex_whitespace.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/lex_whitespace.exp      Fri Sep 10 19:40:18 2021 +0000
@@ -0,0 +1,4 @@
+lex_whitespace.c(13): warning: typedef declares no type name [72]
+lex_whitespace.c(17): warning: typedef declares no type name [72]
+lex_whitespace.c(21): warning: typedef declares no type name [72]
+lex_whitespace.c(25): warning: typedef declares no type name [72]



Home | Main Index | Thread Index | Old Index