aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.gb/sig09.C
blob: a2e3b33e192bdff2832764c11d0f991b9f42abf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Special g++ Options: -fhandle-signatures
// GROUPS passed gb sigptr assignment initialization new
// Test assignment to/initialization of signature pointer with run-time value.

extern "C"
{
  int printf (char *, ...);
}

class C
{
public:
  int f (void) { return 1; }
};

signature S
{
  int f (void);
};

S * p1 = new C;

int main (void)
{
  S * p2 = new C;
  S * p3;

  p3 = new C;

  if (p1->f () + p2->f () + p3->f () == 3)
    printf ("PASS\n");

  return 0;
}