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 for struct that only has ...



details:   https://anonhg.NetBSD.org/src/rev/e7ae9a9a7e1b
branches:  trunk
changeset: 347224:e7ae9a9a7e1b
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 18 14:45:56 2016 +0000

description:
new test for struct that only has anon members, and that the size of struct
is computer right.

diffstat:

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

diffs (37 lines):

diff -r 509d8cbf0d74 -r e7ae9a9a7e1b tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Thu Aug 18 14:43:31 2016 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Thu Aug 18 14:45:56 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2015/10/14 16:32:55 christos Exp $
+# $NetBSD: Makefile,v 1.12 2016/08/18 14:45:56 christos Exp $
 
 NOMAN=         # defined
 
@@ -11,6 +11,7 @@
 FILESDIR=      ${TESTSDIR}
 FILES+=                d_alignof.c
 FILES+=                d_c99_anon_struct.c
+FILES+=                d_c99_anon_union.c
 FILES+=                d_c99_complex_num.c
 FILES+=                d_c99_complex_split.c
 FILES+=                d_c99_compound_literal_comma.c
diff -r 509d8cbf0d74 -r e7ae9a9a7e1b tests/usr.bin/xlint/lint1/d_c99_anon_union.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_anon_union.c      Thu Aug 18 14:45:56 2016 +0000
@@ -0,0 +1,16 @@
+/* struct with only anonymous members */
+
+struct foo {
+       union {
+               long loo;
+               double doo;
+       };
+};
+
+int
+main(void) {
+
+       struct foo *f = 0;
+       printf("%p\n", &f[1]);
+       return 0;
+}



Home | Main Index | Thread Index | Old Index