freebsd-dev/contrib/netbsd-tests/usr.bin/xlint/lint1/d_compound_literals2.c
Enji Cooper 57718be8fa Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
minus the vendor Makefiles

Provide directions for how to bootstrap the vendor sources in
FREEBSD-upgrade

MFC after 2 weeks
Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division
2014-10-02 23:26:49 +00:00

19 lines
193 B
C

/* compound literals */
struct p {
short a, b, c, d;
} zz = {
1, 2, 3, 4
};
struct p *bar(int i)
{
static struct p q[10];
return &q[i];
}
foo()
{
*bar(1) = (struct p) { 1, 2, 3, 4 };
}