Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.law/ctors8.C

raw
1 // { dg-do run }
2 // GROUPS passed constructors
3 // ctor file
4 // Message-Id: <[email protected]>
5 // From: Taj Khattra <[email protected]>
6 // Subject: gcc 2.3.1 global ctor bug ?
7 // Date: Tue, 15 Dec 92 22:09:37 PST
8
9 #include <stdio.h>
10
11 struct foo {
12 foo() : index(-1) {}
13 int index;
14 };
15
16 foo *arr = new foo[2];
17
18 int main()
19 {
20 if (arr[0].index == -1
21 && arr[1].index == -1)
22 printf ("PASS\n");
23 else
24 { printf ("FAIL\n"); return 1; }
25 }