From be8b04496302184c6e8f04d6179f9c3afc50aeb6 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 6 Jan 2016 01:47:28 -0800 Subject: initial commit --- gcc/testsuite/gcc.misc-tests/m-un-2.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 gcc/testsuite/gcc.misc-tests/m-un-2.c (limited to 'gcc/testsuite/gcc.misc-tests/m-un-2.c') diff --git a/gcc/testsuite/gcc.misc-tests/m-un-2.c b/gcc/testsuite/gcc.misc-tests/m-un-2.c new file mode 100755 index 0000000..8c3a8bc --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/m-un-2.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-W -Wall" } */ + +typedef unsigned long size_t; +extern void* malloc (size_t); +extern void free (void*); +extern void* realloc (void*, size_t); + +struct vtable { + void* (* _malloc) (size_t); + void (* _free) (void*); + void* (* _realloc) (void*, size_t); +}; + +struct vtable mtable = { + malloc, + free +}; /* { dg-warning "missing initializer for `mtable._realloc'" "warning regression" } */ + +struct vtable mtable2 = { + ._malloc = malloc, + ._realloc = realloc +}; /* { dg-warning "missing initializer for `mtable2._free'" "warning regression" } */ + +struct vtable mtable3 = { + ._free = free, + ._malloc = malloc, + ._realloc = realloc +}; -- cgit v1.2.3