aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.gb/sig13.C
blob: f5da9f8088802fa58106c19d45e9b0aba538da7e (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
35
36
37
38
// Special g++ Options: -fhandle-signatures
// GROUPS passed gb sigptr assignment initialization
// Test assignment of/initialization with same type signature pointer.

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

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

signature S
{
  int f (void);
};

C a;
S * p1 = &a;
S * q1 = p1;

int main (void)
{
  C a;
  S * p2 = &a;
  S * q2 = p2;
  S * q3;

  q3 = p2;

  if (q1->f () + q2->f () + q3->f () == 3)
    printf ("PASS\n");

  return 0;
}