xref: /netbsd-src/tests/usr.bin/xlint/lint1/d_lint_assert.c (revision dd75ac5b443e967e26b4d18cc8cd5eb98512bfbf)
1 /*	$NetBSD: d_lint_assert.c,v 1.7 2023/03/28 14:44:34 rillig Exp $	*/
2 # 3 "d_lint_assert.c"
3 
4 /*
5  * Trigger the various assertions in the lint1 code.  Several of them are
6  * just hard to trigger, but not impossible.
7 */
8 
9 /* lint1-extra-flags: -X 351 */
10 
11 enum {
12 	// Before decl.c 1.118 from 2021-01-10:
13 	// lint: assertion "sym->s_scl == EXTERN || sym->s_scl == STATIC"
14 	// failed in check_global_variable at decl.c:3135
15 	// near d_lint_assert.c:14
16 	A = +++
17 };
18 /* expect-1: error: syntax error '}' [249] */
19 
20 /*
21  * Before decl.c 1.196 from 2021-07-10, lint ran into an assertion failure
22  * for 'sym->s_type != NULL' in declare_argument.
23  */
24 /* expect+1: warning: old-style declaration; add 'int' [1] */
25 c(void());
26