OSDN Git Service

* gcc.c-torture/compile/991208-1.c: New test.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.misc-tests / m-un-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-W -Wall" } */
3
4 typedef unsigned long size_t;
5 extern void* malloc (size_t);
6 extern void free (void*);
7 extern void* realloc (void*, size_t);
8
9 struct vtable {
10   void* (* _malloc) (size_t);
11   void (* _free) (void*);
12   void* (* _realloc) (void*, size_t);
13 };
14
15 struct vtable mtable = {
16   malloc,
17   free
18 }; /* { dg-warning "missing initializer" "warning regression" { target *-*-* } {18} } */
19    /* { dg-warning "initialization for `mtable._realloc'" "warning regression" { target *-*-* } {18} } */
20
21 struct vtable mtable2 = {
22   ._malloc = malloc,
23   ._realloc = realloc
24 }; /* { dg-warning "missing initializer" "warning regression" { target *-*-* } {24} } */
25    /* { dg-warning "initialization for `mtable2._free'" "warning regression" { target *-*-* } {24} } */
26
27 struct vtable mtable3 = {
28   ._free = free,
29   ._malloc = malloc,
30   ._realloc = realloc
31 };