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 add more tests
details: https://anonhg.NetBSD.org/src/rev/49cc8db57bfe
branches: trunk
changeset: 328778:49cc8db57bfe
user: christos <christos%NetBSD.org@localhost>
date: Thu Apr 17 18:34:44 2014 +0000
description:
add more tests
diffstat:
tests/usr.bin/xlint/lint1/Makefile | 5 ++++-
tests/usr.bin/xlint/lint1/d_c99_complex_split.c | 5 +++++
tests/usr.bin/xlint/lint1/d_cvt_constant.c | 8 ++++++++
tests/usr.bin/xlint/lint1/d_gcc_extension.c | 6 ++++++
tests/usr.bin/xlint/lint1/t_integration.sh | 6 ++++--
5 files changed, 27 insertions(+), 3 deletions(-)
diffs (85 lines):
diff -r 68f60efb5e28 -r 49cc8db57bfe tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile Thu Apr 17 18:23:18 2014 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile Thu Apr 17 18:34:44 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2014/02/04 08:08:59 njoly Exp $
+# $NetBSD: Makefile,v 1.3 2014/04/17 18:34:44 christos Exp $
NOMAN= # defined
@@ -11,6 +11,7 @@
FILESDIR= ${TESTSDIR}
FILES+= d_alignof.c
FILES+= d_c99_complex_num.c
+FILES+= d_c99_complex_split.c
FILES+= d_c99_decls_after_stmt.c
FILES+= d_c99_decls_after_stmt2.c
FILES+= d_c99_decls_after_stmt3.c
@@ -31,10 +32,12 @@
FILES+= d_constant_conv1.c
FILES+= d_constant_conv2.c
FILES+= d_cvt_in_ternary.c
+FILES+= d_cvt_constant.c
FILES+= d_ellipsis_in_switch.c
FILES+= d_gcc_compound_statements1.c
FILES+= d_gcc_compound_statements2.c
FILES+= d_gcc_compound_statements3.c
+FILES+= d_gcc_extension.c
FILES+= d_gcc_func.c
FILES+= d_gcc_variable_array_init.c
FILES+= d_incorrect_array_size.c
diff -r 68f60efb5e28 -r 49cc8db57bfe tests/usr.bin/xlint/lint1/d_c99_complex_split.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_complex_split.c Thu Apr 17 18:34:44 2014 +0000
@@ -0,0 +1,5 @@
+void a(void) {
+ double _Complex z = 0;
+ if (__builtin_isnan((__real__ z)) && __builtin_isnan((__imag__ z)))
+ return;
+}
diff -r 68f60efb5e28 -r 49cc8db57bfe tests/usr.bin/xlint/lint1/d_cvt_constant.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_cvt_constant.c Thu Apr 17 18:34:44 2014 +0000
@@ -0,0 +1,8 @@
+/* the second assignment assumes failed before */
+int
+main(void) {
+ double x = 1;
+ int foo = 0;
+ if (foo)
+ x = 1;
+}
diff -r 68f60efb5e28 -r 49cc8db57bfe tests/usr.bin/xlint/lint1/d_gcc_extension.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_gcc_extension.c Thu Apr 17 18:34:44 2014 +0000
@@ -0,0 +1,6 @@
+/* extension */
+void a(void) {
+ double __logbw = 1;
+ if (__extension__(({ __typeof((__logbw)) x_ = (__logbw); !__builtin_isinf((x_)) && !__builtin_isnan((x_)); })))
+ __logbw = 1;
+}
diff -r 68f60efb5e28 -r 49cc8db57bfe tests/usr.bin/xlint/lint1/t_integration.sh
--- a/tests/usr.bin/xlint/lint1/t_integration.sh Thu Apr 17 18:23:18 2014 +0000
+++ b/tests/usr.bin/xlint/lint1/t_integration.sh Thu Apr 17 18:34:44 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.2 2014/02/04 08:08:59 njoly Exp $
+# $NetBSD: t_integration.sh,v 1.3 2014/04/17 18:34:44 christos Exp $
#
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -93,11 +93,13 @@
"statements with non-expressions"
test_case check_valid gcc_compound_statements3 "Checks GCC compound" \
"statements with void type"
+test_case check_valid gcc_extension "Checks GCC __extension__ and __typeof__"
test_case check_valid cvt_in_ternary "Checks CVT nodes handling in ?" \
- "operator"
+test_case check_valid cvt_constant "Checks constant conversion"
test_case check_valid ellipsis_in_switch "Checks ellipsis in switch()"
test_case check_valid c99_complex_num "Checks C99 complex numbers"
+test_case check_valid c99_complex_split "Checks C99 complex access"
test_case check_valid c99_for_loops "Checks C99 for loops"
test_case check_valid alignof "Checks __alignof__"
test_case check_valid shift_to_narrower_type "Checks that type shifts that" \
Home |
Main Index |
Thread Index |
Old Index