lint: add test for triggering assertion failures in lint1

This commit is contained in:
rillig 2021-01-10 18:06:38 +00:00
parent 76d2ead3e0
commit 0ec7a3ab6a
5 changed files with 28 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1009 2021/01/10 17:43:46 rillig Exp $
# $NetBSD: mi,v 1.1010 2021/01/10 18:06:38 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -5799,6 +5799,8 @@
./usr/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_init_pop_member.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_init_pop_member.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_lint_assert.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_lint_assert.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_long_double_int.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_long_double_int.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_nested_structs.c tests-usr.bin-tests compattestfile,atf

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.27 2021/01/10 17:43:46 rillig Exp $
# $NetBSD: Makefile,v 1.28 2021/01/10 18:06:38 rillig Exp $
NOMAN= # defined
@ -67,6 +67,8 @@ FILES+= d_incorrect_array_size.c
FILES+= d_incorrect_array_size.exp
FILES+= d_init_pop_member.c
FILES+= d_init_pop_member.exp
FILES+= d_lint_assert.c
FILES+= d_lint_assert.exp
FILES+= d_long_double_int.c
FILES+= d_long_double_int.exp
FILES+= d_nested_structs.c

View File

@ -0,0 +1,19 @@
/* $NetBSD: d_lint_assert.c,v 1.1 2021/01/10 18:06:38 rillig Exp $ */
# 3 "d_lint_assert.c"
/*
* Trigger the various assertions in the lint1 code. Several of them are
* just hard to trigger, but not impossible.
*/
/* lint1-extra-flags: -p */
enum {
// lint: assertion "sym->s_scl == EXTERN || sym->s_scl == STATIC"
// failed in check_global_variable at decl.c:3135
// near d_lint_assert.c:14
//A = +++
DUMMY = 0
};
"syntax error to keep the .exp file."

View File

@ -0,0 +1 @@
d_lint_assert.c(19): syntax error '"' [249]

View File

@ -1,4 +1,4 @@
# $NetBSD: t_integration.sh,v 1.23 2021/01/10 17:43:46 rillig Exp $
# $NetBSD: t_integration.sh,v 1.24 2021/01/10 18:06:38 rillig Exp $
#
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@ -79,6 +79,7 @@ test_case decl_old_style_arguments
test_case fold_test
test_case gcc_extension
test_case init_pop_member
test_case lint_assert
test_case return_type
test_case type_question_colon
test_case typefun