Module Name: src
Committed By: christos
Date: Wed Oct 14 16:32:55 UTC 2015
Modified Files:
src/tests/usr.bin/xlint/lint1: Makefile
Added Files:
src/tests/usr.bin/xlint/lint1: d_c99_anon_struct.c
Log Message:
Add an anonymous struct test
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.10 src/tests/usr.bin/xlint/lint1/Makefile:1.11
--- src/tests/usr.bin/xlint/lint1/Makefile:1.10 Wed Jul 29 14:26:15 2015
+++ src/tests/usr.bin/xlint/lint1/Makefile Wed Oct 14 12:32:55 2015
@@ -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 @@ TESTS_SH= t_integration
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
Added files:
Index: src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c:1.1
--- /dev/null Wed Oct 14 12:32:55 2015
+++ src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c Wed Oct 14 12:32:55 2015
@@ -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;
+}
+