Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/xlint/lint1 lint: add expections to tests



details:   https://anonhg.NetBSD.org/src/rev/1c6f3e0c77e5
branches:  trunk
changeset: 950790:1c6f3e0c77e5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 31 11:12:07 2021 +0000

description:
lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type

diffstat:

 tests/usr.bin/xlint/lint1/msg_000.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_001.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_002.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_003.c   |   8 ++--
 tests/usr.bin/xlint/lint1/msg_004.c   |   8 ++--
 tests/usr.bin/xlint/lint1/msg_005.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_006.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_007.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_008.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_009.c   |  10 ++--
 tests/usr.bin/xlint/lint1/msg_027.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_029.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_031.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_034.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_035.c   |  36 +++++++++---------
 tests/usr.bin/xlint/lint1/msg_036.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_037.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_050.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_051.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_054.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_055.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_056.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_057.c   |   8 ++--
 tests/usr.bin/xlint/lint1/msg_060.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_061.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_066.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_068.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_071.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_072.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_073.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_074.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_075.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_081.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_082.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_083.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_084.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_086.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_087.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_088.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_089.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_093.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_094.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_095.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_096.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_097.c   |  10 ++--
 tests/usr.bin/xlint/lint1/msg_098.c   |  12 +++---
 tests/usr.bin/xlint/lint1/msg_099.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_100.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_101.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_108.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_109.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_114.c   |   8 ++--
 tests/usr.bin/xlint/lint1/msg_115.c   |  16 ++++----
 tests/usr.bin/xlint/lint1/msg_116.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_117.c   |  10 ++--
 tests/usr.bin/xlint/lint1/msg_120.c   |  10 ++--
 tests/usr.bin/xlint/lint1/msg_121.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_122.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_125.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_126.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_127.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_127.exp |   1 -
 tests/usr.bin/xlint/lint1/msg_130.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_133.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_136.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_142.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_143.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_144.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_145.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_146.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_146.exp |   1 -
 tests/usr.bin/xlint/lint1/msg_150.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_156.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_160.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_164.c   |  10 ++--
 tests/usr.bin/xlint/lint1/msg_165.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_167.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_169.c   |  69 +++++++++++++++++-----------------
 tests/usr.bin/xlint/lint1/msg_169.exp |   4 +-
 tests/usr.bin/xlint/lint1/msg_170.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_172.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_173.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_174.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_180.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_204.c   |  14 +++---
 tests/usr.bin/xlint/lint1/msg_219.c   |   8 ++--
 tests/usr.bin/xlint/lint1/msg_221.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_230.c   |   8 ++--
 tests/usr.bin/xlint/lint1/msg_232.c   |   4 +-
 tests/usr.bin/xlint/lint1/msg_265.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_308.c   |   6 +-
 tests/usr.bin/xlint/lint1/msg_324.c   |  16 ++++----
 92 files changed, 301 insertions(+), 302 deletions(-)

diffs (truncated from 1823 to 300 lines):

diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_000.c
--- a/tests/usr.bin/xlint/lint1/msg_000.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_000.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,10 +1,10 @@
-/*     $NetBSD: msg_000.c,v 1.2 2021/01/02 18:06:01 rillig Exp $       */
+/*     $NetBSD: msg_000.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_000.c"
 
 // Test for message: empty declaration [0]
 
 extern int extern_declared;
 
-;
+;                              /* expect: 0 */
 
-static int local_defined;
+static int local_defined;      /* expect: 226 */
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_001.c
--- a/tests/usr.bin/xlint/lint1/msg_001.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_001.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: msg_001.c,v 1.2 2021/01/02 18:06:01 rillig Exp $       */
+/*     $NetBSD: msg_001.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_001.c"
 
 // Test for message: old style declaration; add int [1]
 
-old_style = 1;
+old_style = 1;                 /* expect: [1] */
 
 int new_style = 1;
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_002.c
--- a/tests/usr.bin/xlint/lint1/msg_002.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_002.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: msg_002.c,v 1.2 2021/01/02 18:06:01 rillig Exp $       */
+/*     $NetBSD: msg_002.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_002.c"
 
 // Test for message: empty declaration [2]
 
-int;
+int;                           /* expect: 2 */
 
 int local_variable;
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_003.c
--- a/tests/usr.bin/xlint/lint1/msg_003.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_003.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_003.c,v 1.2 2021/01/31 09:21:24 rillig Exp $       */
+/*     $NetBSD: msg_003.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_003.c"
 
 // Test for message: %s declared in argument declaration list [3]
@@ -6,8 +6,8 @@
 /*ARGSUSED*/
 void
 example(declare_struct, declare_union, declare_enum)
-    struct struct_in_argument *declare_struct;
-    union union_in_argument *declare_union;
-    enum enum_in_argument *declare_enum;
+    struct struct_in_argument *declare_struct; /* expect: 3 */
+    union union_in_argument *declare_union;    /* expect: 3 */
+    enum enum_in_argument *declare_enum;       /* expect: 3 */
 {
 }
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_004.c
--- a/tests/usr.bin/xlint/lint1/msg_004.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_004.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_004.c,v 1.2 2021/01/02 18:06:01 rillig Exp $       */
+/*     $NetBSD: msg_004.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_004.c"
 
 // Test for message: illegal type combination [4]
@@ -10,12 +10,12 @@
 double ok_double;
 float _Complex ok_float_complex;
 
-int _Complex illegal_int_complex;
+int _Complex illegal_int_complex;      /* expect: 4, 308 */
 
 char enum {
        CHAR
-};
+};                                     /* expect: 4 */
 
 long struct {
        int member;
-};
+};                                     /* expect: 4 */
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_005.c
--- a/tests/usr.bin/xlint/lint1/msg_005.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_005.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: msg_005.c,v 1.2 2021/01/02 18:06:01 rillig Exp $       */
+/*     $NetBSD: msg_005.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_005.c"
 
 // Test for message: modifying typedef with '%s'; only qualifiers allowed [5]
 
 typedef int number;
-number long long_variable;
+number long long_variable;     /* expect: 5 */
 number const const_variable;
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_006.c
--- a/tests/usr.bin/xlint/lint1/msg_006.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_006.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_006.c,v 1.2 2021/01/07 18:37:41 rillig Exp $       */
+/*     $NetBSD: msg_006.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_006.c"
 
 // Test for message: use 'double' instead of 'long float' [6]
 
-long float x;
+long float x;                  /* expect: 6, 4 */
 double x;
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_007.c
--- a/tests/usr.bin/xlint/lint1/msg_007.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_007.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_007.c,v 1.2 2021/01/07 18:37:41 rillig Exp $       */
+/*     $NetBSD: msg_007.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_007.c"
 
 // Test for message: only one storage class allowed [7]
 
-extern static void example(void);
+extern static void example(void);      /* expect: 7 */
 extern extern_function(void);
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_008.c
--- a/tests/usr.bin/xlint/lint1/msg_008.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_008.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: msg_008.c,v 1.2 2021/01/07 18:37:41 rillig Exp $       */
+/*     $NetBSD: msg_008.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_008.c"
 
 // Test for message: illegal storage class [8]
 
 typedef void
 example(void)
-{
+{                              /* expect: 8 */
 }
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_009.c
--- a/tests/usr.bin/xlint/lint1/msg_009.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_009.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: msg_009.c,v 1.2 2021/01/07 18:37:41 rillig Exp $       */
+/*     $NetBSD: msg_009.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_009.c"
 
 // Test for message: only register valid as formal parameter storage class [9]
 
-extern void typedef_example(typedef int param);
-extern void auto_example(auto int param);
-extern void static_example(static int param);
-extern void extern_example(extern int param);
+extern void typedef_example(typedef int param);        /* expect: 9 */
+extern void auto_example(auto int param);      /* expect: 9 */
+extern void static_example(static int param);  /* expect: 9 */
+extern void extern_example(extern int param);  /* expect: 9 */
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_027.c
--- a/tests/usr.bin/xlint/lint1/msg_027.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_027.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: msg_027.c,v 1.2 2021/01/03 15:35:00 rillig Exp $       */
+/*     $NetBSD: msg_027.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_027.c"
 
 // Test for message: redeclaration of %s [27]
 
 extern int identifier(void);
 
-extern double identifier(void);
+extern double identifier(void);                /* expect: 27 */
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_029.c
--- a/tests/usr.bin/xlint/lint1/msg_029.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_029.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_029.c,v 1.2 2021/01/03 15:35:00 rillig Exp $       */
+/*     $NetBSD: msg_029.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_029.c"
 
 // Test for message: previously declared extern, becomes static: %s [29]
@@ -6,6 +6,6 @@
 extern int function(void);
 
 static int function(void)
-{
+{                              /* expect: 29 */
        return function();
 }
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_031.c
--- a/tests/usr.bin/xlint/lint1/msg_031.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_031.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_031.c,v 1.2 2021/01/03 15:35:00 rillig Exp $       */
+/*     $NetBSD: msg_031.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_031.c"
 
 // Test for message: incomplete structure or union %s: %s [31]
@@ -7,9 +7,9 @@
        int dummy;
 };
 
-struct incomplete;
+struct incomplete;                     /* expect: 233 */
 
 
 struct complete complete_var;
 
-struct incomplete incomplete_var;
+struct incomplete incomplete_var;      /* expect: 31 */
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_034.c
--- a/tests/usr.bin/xlint/lint1/msg_034.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_034.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_034.c,v 1.2 2021/01/03 15:35:00 rillig Exp $       */
+/*     $NetBSD: msg_034.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_034.c"
 
 // Test for message: nonportable bit-field type [34]
@@ -6,6 +6,6 @@
 /* lint1-flags: -S -g -p -w */
 
 struct example {
-       int nonportable: 1;
+       int nonportable: 1;             /* expect: 34 */
        unsigned int portable: 1;
 };
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_035.c
--- a/tests/usr.bin/xlint/lint1/msg_035.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_035.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_035.c,v 1.5 2021/01/02 17:17:00 rillig Exp $       */
+/*     $NetBSD: msg_035.c,v 1.6 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_035.c"
 
 // Test for message: illegal bit-field type [35]
@@ -38,24 +38,24 @@
        unsigned short unsigned_short_flag: 1;
        int int_flag: 1;
        unsigned int unsigned_int_flag: 1;
-       long long_flag: 1;
-       unsigned long unsigned_long_flag: 1;
-       long long long_long_flag: 1;
-       unsigned long long unsigned_long_long_flag: 1;
+       long long_flag: 1;                              /* expect: 35 */
+       unsigned long unsigned_long_flag: 1;            /* expect: 35 */
+       long long long_long_flag: 1;                    /* expect: 35 */
+       unsigned long long unsigned_long_long_flag: 1;  /* expect: 35 */
        /* __int128_t omitted since it is not always defined */
        /* __uint128_t omitted since it is not always defined */
-       float float_flag: 1;
-       double double_flag: 1;
-       long double long_double_flag: 1;
-       void void_flag: 1;
-       example_struct struct_flag: 1;
-       example_union union_flag: 1;
+       float float_flag: 1;                            /* expect: 35 */
+       double double_flag: 1;                          /* expect: 35 */
+       long double long_double_flag: 1;                /* expect: 35 */
+       void void_flag: 1;                              /* expect: 19, 37 */
+       example_struct struct_flag: 1;                  /* expect: 35 */
+       example_union union_flag: 1;                    /* expect: 35 */
        example_enum enum_flag: 1;
-       void *pointer_flag: 1;
-       unsigned int array_flag[4]: 1;
-       example_function function_flag: 1;
-       _Complex complex_flag: 1;
-       float _Complex float_complex_flag: 1;
-       double _Complex double_complex_flag: 1;
-       long double _Complex long_double_complex_flag: 1;
+       void *pointer_flag: 1;                          /* expect: 35 */
+       unsigned int array_flag[4]: 1;                  /* expect: 35 */
+       example_function function_flag: 1;              /* expect: 35 */
+       _Complex complex_flag: 1;                       /* expect: 35, 308 */
+       float _Complex float_complex_flag: 1;           /* expect: 35 */
+       double _Complex double_complex_flag: 1;         /* expect: 35 */
+       long double _Complex long_double_complex_flag: 1; /* expect: 35 */
 };
diff -r 33bc734bf8d0 -r 1c6f3e0c77e5 tests/usr.bin/xlint/lint1/msg_036.c
--- a/tests/usr.bin/xlint/lint1/msg_036.c       Sun Jan 31 09:48:47 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_036.c       Sun Jan 31 11:12:07 2021 +0000
@@ -1,10 +1,10 @@
-/*     $NetBSD: msg_036.c,v 1.2 2021/01/03 15:35:00 rillig Exp $       */
+/*     $NetBSD: msg_036.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
 # 3 "msg_036.c"
 
 // Test for message: illegal bit-field size: %d [36]
 
 struct example {
-       unsigned int too_large: 100000;
-       unsigned int negative: -1;
+       unsigned int too_large: 100000; /* expect: 36 */
+       unsigned int negative: -1;      /* expect: 36 */
        unsigned int ok: 3;



Home | Main Index | Thread Index | Old Index