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 new test



details:   https://anonhg.NetBSD.org/src/rev/b5b5816b72ca
branches:  trunk
changeset: 809733:b5b5816b72ca
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 29 18:26:15 2015 +0000

description:
new test

diffstat:

 tests/usr.bin/xlint/lint1/Makefile                |   3 ++-
 tests/usr.bin/xlint/lint1/d_type_question_colon.c |  14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r b2ef00d3feed -r b5b5816b72ca tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Wed Jul 29 18:23:32 2015 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Wed Jul 29 18:26:15 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2015/07/28 18:05:19 christos Exp $
+# $NetBSD: Makefile,v 1.10 2015/07/29 18:26:15 christos Exp $
 
 NOMAN=         # defined
 
@@ -54,6 +54,7 @@
 FILES+=                d_type_conv1.c
 FILES+=                d_type_conv2.c
 FILES+=                d_type_conv3.c
+FILES+=                d_type_question_colon.c
 FILES+=                d_typename_as_var.c
 FILES+=                d_typefun.c
 FILES+=                d_zero_sized_arrays.c
diff -r b2ef00d3feed -r b5b5816b72ca tests/usr.bin/xlint/lint1/d_type_question_colon.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_type_question_colon.c Wed Jul 29 18:26:15 2015 +0000
@@ -0,0 +1,14 @@
+/* the type of the ?: expression should be the more specific type */
+
+struct foo {
+       int bar;
+};
+
+void
+test(void) {
+       int i;
+       struct foo *ptr = 0;
+
+       for (i = (ptr ? ptr : (void *)0)->bar; i < 10; i++)
+               test();
+}



Home | Main Index | Thread Index | Old Index