tests/lint: test struct declarationsdiff -r1.1089 -r1.1090 src/distrib/sets/lists/tests/mi
(rillig)
--- src/distrib/sets/lists/tests/mi 2021/07/15 17:09:08 1.1089
+++ src/distrib/sets/lists/tests/mi 2021/07/15 19:51:29 1.1090
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: mi,v 1.1089 2021/07/15 17:09:08 rillig Exp $ | 1 | # $NetBSD: mi,v 1.1090 2021/07/15 19:51:29 rillig Exp $ | |
2 | # | 2 | # | |
3 | # Note: don't delete entries from here - mark them as "obsolete" instead. | 3 | # Note: don't delete entries from here - mark them as "obsolete" instead. | |
4 | # | 4 | # | |
5 | ./etc/mtree/set.tests tests-sys-root | 5 | ./etc/mtree/set.tests tests-sys-root | |
6 | ./usr/libdata/debug/usr/tests tests-base-debug compattestdir | 6 | ./usr/libdata/debug/usr/tests tests-base-debug compattestdir | |
7 | ./usr/libdata/debug/usr/tests/atf tests-atf-debug compattestfile,atf | 7 | ./usr/libdata/debug/usr/tests/atf tests-atf-debug compattestfile,atf | |
8 | ./usr/libdata/debug/usr/tests/atf/atf-c tests-atf-debug compattestfile,atf | 8 | ./usr/libdata/debug/usr/tests/atf/atf-c tests-atf-debug compattestfile,atf | |
9 | ./usr/libdata/debug/usr/tests/atf/atf-c++ tests-atf-debug compattestfile,atf | 9 | ./usr/libdata/debug/usr/tests/atf/atf-c++ tests-atf-debug compattestfile,atf | |
10 | ./usr/libdata/debug/usr/tests/atf/atf-c++/detail tests-atf-debug compattestfile,atf | 10 | ./usr/libdata/debug/usr/tests/atf/atf-c++/detail tests-atf-debug compattestfile,atf | |
11 | ./usr/libdata/debug/usr/tests/atf/atf-c/detail tests-atf-debug compattestfile,atf | 11 | ./usr/libdata/debug/usr/tests/atf/atf-c/detail tests-atf-debug compattestfile,atf | |
12 | ./usr/libdata/debug/usr/tests/atf/atf-compile tests-obsolete obsolete | 12 | ./usr/libdata/debug/usr/tests/atf/atf-compile tests-obsolete obsolete | |
13 | ./usr/libdata/debug/usr/tests/atf/atf-report tests-obsolete obsolete | 13 | ./usr/libdata/debug/usr/tests/atf/atf-report tests-obsolete obsolete | |
14 | ./usr/libdata/debug/usr/tests/atf/atf-run tests-obsolete obsolete | 14 | ./usr/libdata/debug/usr/tests/atf/atf-run tests-obsolete obsolete | |
@@ -6208,26 +6208,28 @@ | @@ -6208,26 +6208,28 @@ | |||
6208 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv1.exp tests-usr.bin-tests compattestfile,atf | 6208 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv1.exp tests-usr.bin-tests compattestfile,atf | |
6209 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv2.c tests-usr.bin-tests compattestfile,atf | 6209 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv2.c tests-usr.bin-tests compattestfile,atf | |
6210 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv2.exp tests-usr.bin-tests compattestfile,atf | 6210 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv2.exp tests-usr.bin-tests compattestfile,atf | |
6211 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv3.c tests-usr.bin-tests compattestfile,atf | 6211 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv3.c tests-usr.bin-tests compattestfile,atf | |
6212 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv3.exp tests-usr.bin-tests compattestfile,atf | 6212 | ./usr/tests/usr.bin/xlint/lint1/d_type_conv3.exp tests-usr.bin-tests compattestfile,atf | |
6213 | ./usr/tests/usr.bin/xlint/lint1/d_type_question_colon.c tests-usr.bin-tests compattestfile,atf | 6213 | ./usr/tests/usr.bin/xlint/lint1/d_type_question_colon.c tests-usr.bin-tests compattestfile,atf | |
6214 | ./usr/tests/usr.bin/xlint/lint1/d_typefun.c tests-usr.bin-tests compattestfile,atf | 6214 | ./usr/tests/usr.bin/xlint/lint1/d_typefun.c tests-usr.bin-tests compattestfile,atf | |
6215 | ./usr/tests/usr.bin/xlint/lint1/d_typename_as_var.c tests-usr.bin-tests compattestfile,atf | 6215 | ./usr/tests/usr.bin/xlint/lint1/d_typename_as_var.c tests-usr.bin-tests compattestfile,atf | |
6216 | ./usr/tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c tests-usr.bin-tests compattestfile,atf | 6216 | ./usr/tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c tests-usr.bin-tests compattestfile,atf | |
6217 | ./usr/tests/usr.bin/xlint/lint1/decl.c tests-usr.bin-tests compattestfile,atf | 6217 | ./usr/tests/usr.bin/xlint/lint1/decl.c tests-usr.bin-tests compattestfile,atf | |
6218 | ./usr/tests/usr.bin/xlint/lint1/decl.exp tests-usr.bin-tests compattestfile,atf | 6218 | ./usr/tests/usr.bin/xlint/lint1/decl.exp tests-usr.bin-tests compattestfile,atf | |
6219 | ./usr/tests/usr.bin/xlint/lint1/decl_arg.c tests-usr.bin-tests compattestfile,atf | 6219 | ./usr/tests/usr.bin/xlint/lint1/decl_arg.c tests-usr.bin-tests compattestfile,atf | |
6220 | ./usr/tests/usr.bin/xlint/lint1/decl_arg.exp tests-usr.bin-tests compattestfile,atf | 6220 | ./usr/tests/usr.bin/xlint/lint1/decl_arg.exp tests-usr.bin-tests compattestfile,atf | |
6221 | ./usr/tests/usr.bin/xlint/lint1/decl_struct_c90.c tests-usr.bin-tests compattestfile,atf | |||
6222 | ./usr/tests/usr.bin/xlint/lint1/decl_struct_c90.exp tests-usr.bin-tests compattestfile,atf | |||
6221 | ./usr/tests/usr.bin/xlint/lint1/decl_struct_member.c tests-usr.bin-tests compattestfile,atf | 6223 | ./usr/tests/usr.bin/xlint/lint1/decl_struct_member.c tests-usr.bin-tests compattestfile,atf | |
6222 | ./usr/tests/usr.bin/xlint/lint1/decl_struct_member.exp tests-usr.bin-tests compattestfile,atf | 6224 | ./usr/tests/usr.bin/xlint/lint1/decl_struct_member.exp tests-usr.bin-tests compattestfile,atf | |
6223 | ./usr/tests/usr.bin/xlint/lint1/emit.c tests-usr.bin-tests compattestfile,atf | 6225 | ./usr/tests/usr.bin/xlint/lint1/emit.c tests-usr.bin-tests compattestfile,atf | |
6224 | ./usr/tests/usr.bin/xlint/lint1/emit.exp tests-usr.bin-tests compattestfile,atf | 6226 | ./usr/tests/usr.bin/xlint/lint1/emit.exp tests-usr.bin-tests compattestfile,atf | |
6225 | ./usr/tests/usr.bin/xlint/lint1/emit.exp-ln tests-usr.bin-tests compattestfile,atf | 6227 | ./usr/tests/usr.bin/xlint/lint1/emit.exp-ln tests-usr.bin-tests compattestfile,atf | |
6226 | ./usr/tests/usr.bin/xlint/lint1/emit.ln tests-obsolete obsolete | 6228 | ./usr/tests/usr.bin/xlint/lint1/emit.ln tests-obsolete obsolete | |
6227 | ./usr/tests/usr.bin/xlint/lint1/expr_precedence.c tests-usr.bin-tests compattestfile,atf | 6229 | ./usr/tests/usr.bin/xlint/lint1/expr_precedence.c tests-usr.bin-tests compattestfile,atf | |
6228 | ./usr/tests/usr.bin/xlint/lint1/expr_precedence.exp tests-usr.bin-tests compattestfile,atf | 6230 | ./usr/tests/usr.bin/xlint/lint1/expr_precedence.exp tests-usr.bin-tests compattestfile,atf | |
6229 | ./usr/tests/usr.bin/xlint/lint1/expr_range.c tests-usr.bin-tests compattestfile,atf | 6231 | ./usr/tests/usr.bin/xlint/lint1/expr_range.c tests-usr.bin-tests compattestfile,atf | |
6230 | ./usr/tests/usr.bin/xlint/lint1/expr_range.exp tests-usr.bin-tests compattestfile,atf | 6232 | ./usr/tests/usr.bin/xlint/lint1/expr_range.exp tests-usr.bin-tests compattestfile,atf | |
6231 | ./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.c tests-usr.bin-tests compattestfile,atf | 6233 | ./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.c tests-usr.bin-tests compattestfile,atf | |
6232 | ./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.exp tests-usr.bin-tests compattestfile,atf | 6234 | ./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.exp tests-usr.bin-tests compattestfile,atf | |
6233 | ./usr/tests/usr.bin/xlint/lint1/gcc_attribute.c tests-usr.bin-tests compattestfile,atf | 6235 | ./usr/tests/usr.bin/xlint/lint1/gcc_attribute.c tests-usr.bin-tests compattestfile,atf |
--- src/tests/usr.bin/xlint/lint1/Makefile 2021/07/15 17:09:08 1.90
+++ src/tests/usr.bin/xlint/lint1/Makefile 2021/07/15 19:51:29 1.91
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.90 2021/07/15 17:09:08 rillig Exp $ | 1 | # $NetBSD: Makefile,v 1.91 2021/07/15 19:51:29 rillig Exp $ | |
2 | 2 | |||
3 | NOMAN= # defined | 3 | NOMAN= # defined | |
4 | MAX_MESSAGE= 345 # see lint1/err.c | 4 | MAX_MESSAGE= 345 # see lint1/err.c | |
5 | 5 | |||
6 | .include <bsd.own.mk> | 6 | .include <bsd.own.mk> | |
7 | 7 | |||
8 | ARCHSUBDIR!= cd ${NETBSDSRCDIR}/usr.bin/xlint/lint1 && ${MAKE} -v ARCHSUBDIR | 8 | ARCHSUBDIR!= cd ${NETBSDSRCDIR}/usr.bin/xlint/lint1 && ${MAKE} -v ARCHSUBDIR | |
9 | 9 | |||
10 | TESTSDIR= ${TESTSBASE}/usr.bin/xlint/lint1 | 10 | TESTSDIR= ${TESTSBASE}/usr.bin/xlint/lint1 | |
11 | 11 | |||
12 | TESTS_SH= t_integration | 12 | TESTS_SH= t_integration | |
13 | TESTS_SH_SRC_t_integration= archsubdir.sh t_integration.sh | 13 | TESTS_SH_SRC_t_integration= archsubdir.sh t_integration.sh | |
14 | 14 | |||
@@ -108,26 +108,28 @@ FILES+= d_type_conv1.c | @@ -108,26 +108,28 @@ FILES+= d_type_conv1.c | |||
108 | FILES+= d_type_conv1.exp | 108 | FILES+= d_type_conv1.exp | |
109 | FILES+= d_type_conv2.c | 109 | FILES+= d_type_conv2.c | |
110 | FILES+= d_type_conv2.exp | 110 | FILES+= d_type_conv2.exp | |
111 | FILES+= d_type_conv3.c | 111 | FILES+= d_type_conv3.c | |
112 | FILES+= d_type_conv3.exp | 112 | FILES+= d_type_conv3.exp | |
113 | FILES+= d_type_question_colon.c | 113 | FILES+= d_type_question_colon.c | |
114 | FILES+= d_typefun.c | 114 | FILES+= d_typefun.c | |
115 | FILES+= d_typename_as_var.c | 115 | FILES+= d_typename_as_var.c | |
116 | FILES+= d_zero_sized_arrays.c | 116 | FILES+= d_zero_sized_arrays.c | |
117 | FILES+= decl.c | 117 | FILES+= decl.c | |
118 | FILES+= decl.exp | 118 | FILES+= decl.exp | |
119 | FILES+= decl_arg.c | 119 | FILES+= decl_arg.c | |
120 | FILES+= decl_arg.exp | 120 | FILES+= decl_arg.exp | |
121 | FILES+= decl_struct_c90.c | |||
122 | FILES+= decl_struct_c90.exp | |||
121 | FILES+= decl_struct_member.c | 123 | FILES+= decl_struct_member.c | |
122 | FILES+= decl_struct_member.exp | 124 | FILES+= decl_struct_member.exp | |
123 | FILES+= emit.c | 125 | FILES+= emit.c | |
124 | FILES+= emit.exp | 126 | FILES+= emit.exp | |
125 | FILES+= emit.exp-ln | 127 | FILES+= emit.exp-ln | |
126 | FILES+= expr_precedence.c | 128 | FILES+= expr_precedence.c | |
127 | FILES+= expr_precedence.exp | 129 | FILES+= expr_precedence.exp | |
128 | FILES+= expr_range.c | 130 | FILES+= expr_range.c | |
129 | FILES+= expr_range.exp | 131 | FILES+= expr_range.exp | |
130 | FILES+= feat_stacktrace.c | 132 | FILES+= feat_stacktrace.c | |
131 | FILES+= feat_stacktrace.exp | 133 | FILES+= feat_stacktrace.exp | |
132 | FILES+= gcc_attribute.c | 134 | FILES+= gcc_attribute.c | |
133 | FILES+= gcc_attribute.exp | 135 | FILES+= gcc_attribute.exp |
/* $NetBSD: decl_struct_c90.c,v 1.1 2021/07/15 19:51:29 rillig Exp $ */
# 3 "decl_struct_c90.c"
/*
* Test declaration of struct types, in C90 without any GNU extensions.
*/
/* lint1-flags: -sw */
/*
* All of K&R, C90, C99 require that a struct member declaration is
* terminated with a semicolon. No idea why lint allows the missing
* semicolon in non-C90 mode.
*/
struct missing_semicolon {
int member
};
/* expect-1: error: syntax requires ';' after last struct/union member [66] */
decl_struct_c90.c(17): error: syntax requires ';' after last struct/union member [66]
--- src/tests/usr.bin/xlint/lint1/decl_struct_member.c 2021/07/14 20:39:13 1.6
+++ src/tests/usr.bin/xlint/lint1/decl_struct_member.c 2021/07/15 19:51:29 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: decl_struct_member.c,v 1.6 2021/07/14 20:39:13 rillig Exp $ */ | 1 | /* $NetBSD: decl_struct_member.c,v 1.7 2021/07/15 19:51:29 rillig Exp $ */ | |
2 | # 3 "decl_struct_member.c" | 2 | # 3 "decl_struct_member.c" | |
3 | 3 | |||
4 | struct multi_attributes { | 4 | struct multi_attributes { | |
5 | __attribute__((deprecated)) | 5 | __attribute__((deprecated)) | |
6 | __attribute__((deprecated)) | 6 | __attribute__((deprecated)) | |
7 | __attribute__((deprecated)) | 7 | __attribute__((deprecated)) | |
8 | int deprecated; | 8 | int deprecated; | |
9 | }; | 9 | }; | |
10 | 10 | |||
11 | struct cover_begin_type_noclass_declspecs { | 11 | struct cover_begin_type_noclass_declspecs { | |
12 | int m1; | 12 | int m1; | |
13 | __attribute__((deprecated)) int m2; | 13 | __attribute__((deprecated)) int m2; | |
14 | const int m3; | 14 | const int m3; | |
@@ -19,26 +19,35 @@ struct cover_begin_type_noclass_declspec | @@ -19,26 +19,35 @@ struct cover_begin_type_noclass_declspec | |||
19 | 19 | |||
20 | typedef int number; | 20 | typedef int number; | |
21 | 21 | |||
22 | struct cover_begin_type_typespec { | 22 | struct cover_begin_type_typespec { | |
23 | int m1; | 23 | int m1; | |
24 | number m2; | 24 | number m2; | |
25 | }; | 25 | }; | |
26 | 26 | |||
27 | struct cover_begin_type_noclass_declmods { | 27 | struct cover_begin_type_noclass_declmods { | |
28 | const m1; | 28 | const m1; | |
29 | const volatile m2; | 29 | const volatile m2; | |
30 | }; | 30 | }; | |
31 | 31 | |||
32 | /* cover struct_or_union_specifier: struct_or_union error */ | |||
33 | /* expect+1: error: syntax error 'goto' [249] */ | |||
34 | struct goto { | |||
35 | /* expect+1: error: illegal type combination [4] */ | |||
36 | int member; | |||
37 | /* expect+1: error: syntax error '}' [249] */ | |||
38 | }; | |||
39 | /* expect-1: warning: empty declaration [0] */ | |||
40 | ||||
32 | /* | 41 | /* | |
33 | * Before cgram.y 1.228 from 2021-06-19, lint ran into an assertion failure: | 42 | * Before cgram.y 1.228 from 2021-06-19, lint ran into an assertion failure: | |
34 | * | 43 | * | |
35 | * "is_struct_or_union(dcs->d_type->t_tspec)" at cgram.y:846 | 44 | * "is_struct_or_union(dcs->d_type->t_tspec)" at cgram.y:846 | |
36 | */ | 45 | */ | |
37 | struct { | 46 | struct { | |
38 | char; /* expect: syntax error 'unnamed member' */ | 47 | char; /* expect: syntax error 'unnamed member' */ | |
39 | }; | 48 | }; | |
40 | 49 | |||
41 | /* | 50 | /* | |
42 | * Before decl.c 1.188 from 2021-06-20, lint ran into a segmentation fault. | 51 | * Before decl.c 1.188 from 2021-06-20, lint ran into a segmentation fault. | |
43 | */ | 52 | */ | |
44 | struct { | 53 | struct { |
--- src/tests/usr.bin/xlint/lint1/Attic/decl_struct_member.exp 2021/07/14 20:39:13 1.5
+++ src/tests/usr.bin/xlint/lint1/Attic/decl_struct_member.exp 2021/07/15 19:51:29 1.6
@@ -1,4 +1,8 @@ | @@ -1,4 +1,8 @@ | |||
1 | decl_struct_member.c(38): error: syntax error 'unnamed member' [249] | 1 | decl_struct_member.c(34): error: syntax error 'goto' [249] | |
2 | decl_struct_member.c(45): error: syntax error '0' [249] | 2 | decl_struct_member.c(36): error: illegal type combination [4] | |
3 | decl_struct_member.c(46): warning: syntax requires ';' after last struct/union member [66] | 3 | decl_struct_member.c(38): error: syntax error '}' [249] | |
4 | decl_struct_member.c(53): error: cannot recover from previous errors [224] | 4 | decl_struct_member.c(38): warning: empty declaration [0] | |
5 | decl_struct_member.c(47): error: syntax error 'unnamed member' [249] | |||
6 | decl_struct_member.c(54): error: syntax error '0' [249] | |||
7 | decl_struct_member.c(55): warning: syntax requires ';' after last struct/union member [66] | |||
8 | decl_struct_member.c(62): error: cannot recover from previous errors [224] |