summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/thunk2.C
blob: 52fcd74bc11ce36256614b4b4302aa8aa6fab868 (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
// PR c++/20206
// { dg-do run }
// { dg-options "-O0" }

void
bar (int x)
{
  asm ("" : : "g" (x));
}

struct S { S () {}; virtual ~S () {}; };
struct T { virtual void foo (int) = 0; };
struct U : public S, public T
{
  bool a;
  U () {}
  virtual ~U () {}
  virtual void foo (int x)
  {
    switch (x)
      {
      case 12:
	break;
      case 9:
	bar (7);
	break;
      case 10:
	bar (12);
	break;
      case 4:
	bar (18);
	break;
      case 2:
	bar (26);
	break;
      }
  }
};
U u;

int
main ()
{
}