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 an anonymous struct test



details:   https://anonhg.NetBSD.org/src/rev/b2907a38bf7c
branches:  trunk
changeset: 811162:b2907a38bf7c
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 14 16:32:55 2015 +0000

description:
Add an anonymous struct test

diffstat:

 tests/usr.bin/xlint/lint1/Makefile            |   3 ++-
 tests/usr.bin/xlint/lint1/d_c99_anon_struct.c |  26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletions(-)

diffs (47 lines):

diff -r a3d39e210eb5 -r b2907a38bf7c tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Wed Oct 14 16:05:14 2015 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Wed Oct 14 16:32:55 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2015/07/29 18:26:15 christos Exp $
+# $NetBSD: Makefile,v 1.11 2015/10/14 16:32:55 christos Exp $
 
 NOMAN=         # defined
 
@@ -10,6 +10,7 @@
 
 FILESDIR=      ${TESTSDIR}
 FILES+=                d_alignof.c
+FILES+=                d_c99_anon_struct.c
 FILES+=                d_c99_complex_num.c
 FILES+=                d_c99_complex_split.c
 FILES+=                d_c99_compound_literal_comma.c
diff -r a3d39e210eb5 -r b2907a38bf7c tests/usr.bin/xlint/lint1/d_c99_anon_struct.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c     Wed Oct 14 16:32:55 2015 +0000
@@ -0,0 +1,26 @@
+/* Anonymous struct test */
+
+typedef int type;
+
+struct point {
+       int x;
+       int y;
+};
+
+struct bar {
+       struct {
+               struct point top_left;
+               struct point bottom_right;
+       };
+       type z;
+};
+
+
+int
+main(void)
+{
+       struct bar b;
+       b.top_left.x = 1;
+       return 0;
+}
+       



Home | Main Index | Thread Index | Old Index