diff --git a/tests/usr.bin/xlint/lint1/Makefile b/tests/usr.bin/xlint/lint1/Makefile index c22f7579551b..aac3eb0e35a0 100644 --- a/tests/usr.bin/xlint/lint1/Makefile +++ b/tests/usr.bin/xlint/lint1/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2020/12/28 09:57:14 rillig Exp $ +# $NetBSD: Makefile,v 1.17 2020/12/28 09:58:56 rillig Exp $ NOMAN= # defined @@ -19,7 +19,7 @@ FILES+= d_c99_compound_literal_comma.c FILES+= d_c99_decls_after_stmt.c FILES+= d_c99_decls_after_stmt2.c FILES+= d_c99_decls_after_stmt3.c -FILES+= d_c99_flex_array_packed.c +FILES+= d_c99_flex_array_packed.c FILES+= d_c99_for_loops.c FILES+= d_c99_func.c FILES+= d_c99_nested_struct.c @@ -40,7 +40,9 @@ FILES+= d_cast_typeof.c FILES+= d_compound_literals1.c FILES+= d_compound_literals2.c FILES+= d_constant_conv1.c +FILES+= d_constant_conv1.exp FILES+= d_constant_conv2.c +FILES+= d_constant_conv2.exp FILES+= d_cvt_constant.c FILES+= d_cvt_in_ternary.c FILES+= d_ellipsis_in_switch.c @@ -51,14 +53,19 @@ FILES+= d_gcc_extension.c FILES+= d_gcc_func.c FILES+= d_gcc_variable_array_init.c FILES+= d_incorrect_array_size.c +FILES+= d_incorrect_array_size.exp FILES+= d_long_double_int.c +FILES+= d_long_double_int.exp FILES+= d_nested_structs.c FILES+= d_nolimit_init.c FILES+= d_packed_structs.c FILES+= d_shift_to_narrower_type.c FILES+= d_type_conv1.c +FILES+= d_type_conv1.exp FILES+= d_type_conv2.c +FILES+= d_type_conv2.exp FILES+= d_type_conv3.c +FILES+= d_type_conv3.exp FILES+= d_type_question_colon.c FILES+= d_typefun.c FILES+= d_typename_as_var.c diff --git a/tests/usr.bin/xlint/lint1/d_constant_conv1.exp b/tests/usr.bin/xlint/lint1/d_constant_conv1.exp new file mode 100644 index 000000000000..1a501e3e5c42 --- /dev/null +++ b/tests/usr.bin/xlint/lint1/d_constant_conv1.exp @@ -0,0 +1 @@ +(11): warning: conversion of negative constant to unsigned type, arg #1 [296] diff --git a/tests/usr.bin/xlint/lint1/d_constant_conv2.exp b/tests/usr.bin/xlint/lint1/d_constant_conv2.exp new file mode 100644 index 000000000000..63b1ec63eab8 --- /dev/null +++ b/tests/usr.bin/xlint/lint1/d_constant_conv2.exp @@ -0,0 +1 @@ +(11): warning: conversion to 'unsigned int' due to prototype, arg #1 [259] diff --git a/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp b/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp new file mode 100644 index 000000000000..7480bb89492f --- /dev/null +++ b/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp @@ -0,0 +1 @@ +(5): negative array dimension (-1) [20] diff --git a/tests/usr.bin/xlint/lint1/d_long_double_int.exp b/tests/usr.bin/xlint/lint1/d_long_double_int.exp new file mode 100644 index 000000000000..a4cb8231039c --- /dev/null +++ b/tests/usr.bin/xlint/lint1/d_long_double_int.exp @@ -0,0 +1 @@ +(9): warning: illegal pointer combination, op p == p [124] diff --git a/tests/usr.bin/xlint/lint1/d_type_conv1.exp b/tests/usr.bin/xlint/lint1/d_type_conv1.exp new file mode 100644 index 000000000000..40a435a81d65 --- /dev/null +++ b/tests/usr.bin/xlint/lint1/d_type_conv1.exp @@ -0,0 +1 @@ +(13): warning: conversion to 'unsigned int' due to prototype, arg #1 [259] diff --git a/tests/usr.bin/xlint/lint1/d_type_conv2.exp b/tests/usr.bin/xlint/lint1/d_type_conv2.exp new file mode 100644 index 000000000000..61a2c28f0487 --- /dev/null +++ b/tests/usr.bin/xlint/lint1/d_type_conv2.exp @@ -0,0 +1 @@ +(13): warning: conversion to 'float' due to prototype, arg #1 [259] diff --git a/tests/usr.bin/xlint/lint1/d_type_conv3.exp b/tests/usr.bin/xlint/lint1/d_type_conv3.exp new file mode 100644 index 000000000000..392fb5d29b9b --- /dev/null +++ b/tests/usr.bin/xlint/lint1/d_type_conv3.exp @@ -0,0 +1,2 @@ +(12): warning: conversion to 'unsigned int' due to prototype, arg #1 [259] +(12): warning: conversion of 'long long' to 'unsigned int' is out of range, arg #1 [295] diff --git a/tests/usr.bin/xlint/lint1/t_integration.sh b/tests/usr.bin/xlint/lint1/t_integration.sh index 037ea8239ce7..a2e1d1f8cadc 100644 --- a/tests/usr.bin/xlint/lint1/t_integration.sh +++ b/tests/usr.bin/xlint/lint1/t_integration.sh @@ -1,4 +1,4 @@ -# $NetBSD: t_integration.sh,v 1.5 2020/06/25 11:12:03 jruoho Exp $ +# $NetBSD: t_integration.sh,v 1.6 2020/12/28 09:58:56 rillig Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -36,8 +36,11 @@ check_valid() check_invalid() { - atf_check -s not-exit:0 -o ignore -e ignore ${LINT1} -g -S -w \ - "$(atf_get_srcdir)/$1" /dev/null + local src="$(atf_get_srcdir)/$1" + local exp="${src%.c}.exp" + + atf_check -s not-exit:0 -o "file:${exp}" -e empty \ + ${LINT1} -g -S -w "${src}" /dev/null } test_case()