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 a test for a typeof cast



details:   https://anonhg.NetBSD.org/src/rev/d28ab97ddef7
branches:  trunk
changeset: 822192:d28ab97ddef7
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 06 12:00:27 2017 +0000

description:
add a test for a typeof cast

diffstat:

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

diffs (33 lines):

diff -r 46050cdeaffb -r d28ab97ddef7 tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Mon Mar 06 11:58:31 2017 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Mon Mar 06 12:00:27 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2016/08/19 10:21:50 christos Exp $
+# $NetBSD: Makefile,v 1.14 2017/03/06 12:00:27 christos Exp $
 
 NOMAN=         # defined
 
@@ -35,6 +35,7 @@
 FILES+=                d_cast_init.c
 FILES+=                d_cast_init2.c
 FILES+=                d_cast_lhs.c
+FILES+=                d_cast_typeof.c
 FILES+=                d_compound_literals1.c
 FILES+=                d_compound_literals2.c
 FILES+=                d_constant_conv1.c
diff -r 46050cdeaffb -r d28ab97ddef7 tests/usr.bin/xlint/lint1/d_cast_typeof.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_cast_typeof.c Mon Mar 06 12:00:27 2017 +0000
@@ -0,0 +1,12 @@
+
+struct foo {
+       char list;
+};
+struct foo *hole;
+
+char *
+foo(void)
+{
+       return ((char *)&((typeof(hole))0)->list);
+}
+



Home | Main Index | Thread Index | Old Index