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/ac366082290c
branches: trunk
changeset: 341020:ac366082290c
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 5d33932e97c8 -r ac366082290c 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 5d33932e97c8 -r ac366082290c 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