summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.old-deja/g++.gb/sig22.C
blob: 25b0a1aa5d1bb7becd9cbc4bdb2f636b8fa4b121 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Special g++ Options: -fhandle-signatures
// GROUPS passed gb sigptr assignment initialization
// Test assignment to/init of sigptr that requires copying sigtable slots.

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

class C
{
public:
  int f (void) { return 1; }
  int g (int)  { return 2; }
  int h (void) { return 666; }
};

signature S
{
  int f (void);
  int g (int);
  int h (void);
};

signature T
{
  int f (void);
  int h (void);
};

signature U
{
  int h (void);
  int g (int);
};

C a;
S * p  = &a;
T * q1 = p;
U * r1 = p;

int main (void)
{
  C a;
  S * p  = &a;
  T * q2 = p;
  U * r2 = p;;
  T * q3;
  U * r3;

  q3 = p;
  r3 = p;

  if (q1->f () + q2->f () + q3->f () == 3
      && r1->g (0) + r2->g (0) + r3->g (0) == 6)
    printf ("PASS\n");

  return 0;
}
OpenPOWER on IntegriCloud