8sa1-gcc/gcc/testsuite/g++.old-deja/g++.law/global-init1.C
Jeff Law 921e5a0eb4 Initial revision
From-SVN: r14840
1997-08-19 01:34:40 -06:00

21 lines
452 B
C

// GROUPS passed initialization
// global-init file
// Message-Id: <9212021756.AA12639@grumpy.pocs.com>
// From: wp@pocs.com (Wolfgang Polak)
// Subject: Initializers - gcc 2.2.2 (g++), Sparc, SunOS 4.1.1
// Date: Wed, 2 Dec 92 09:56:01 PST
#include <stdio.h>
struct S { int a; int c; };
int i = 3;
S s = {6, i};
S * the_s () { return &s; };
main ()
{
S * cls = the_s ();
if (cls->a != 6)
printf ("FAIL\n");
else
printf ("PASS\n");
}