| 1 |
// { dg-do run } |
| 2 |
// GROUPS passed initialization |
| 3 |
// global-init file |
| 4 |
// Message-Id: <[email protected]> |
| 5 |
// From: [email protected] (Wolfgang Polak) |
| 6 |
// Subject: Initializers - gcc 2.2.2 (g++), SPARC, SunOS 4.1.1 |
| 7 |
// Date: Wed, 2 Dec 92 09:56:01 PST |
| 8 |
|
| 9 |
#include <stdio.h> |
| 10 |
struct S { int a; int c; }; |
| 11 |
int i = 3; |
| 12 |
S s = {6, i}; |
| 13 |
S * the_s () { return &s; } |
| 14 |
int main () |
| 15 |
{ |
| 16 |
S * cls = the_s (); |
| 17 |
if (cls->a != 6) |
| 18 |
{ printf ("FAIL\n"); return 1; } |
| 19 |
else |
| 20 |
printf ("PASS\n"); |
| 21 |
} |