OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [pr35504.C] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } }
2
 
3
#define ATTR0 __attribute__((__regparm__(0)))
4
#define ATTR1 __attribute__((__regparm__(1)))
5
#define ATTR2 __attribute__((__regparm__(2)))
6
#define ATTR3 __attribute__((__regparm__(3)))
7
#define ATTR4 __attribute__((__fastcall__))
8
#define ATTR5 __attribute__((__stdcall__))
9
#define ATTR6 __attribute__((__cdecl__))
10
#define ATTR7
11
#define ATTR8 __attribute__((__thiscall__))
12
 
13
extern "C" void abort (void);
14
 
15
struct long_struct
16
{
17
  int a[3];
18
};
19
 
20
struct long_struct ret;
21
 
22
class c3 *this3;
23
 
24
class c1
25
{
26
  int val1;
27
public:
28
    virtual void foo () { }
29
};
30
 
31
class c2
32
{
33
public:
34
  virtual ATTR0 struct long_struct method0 ()
35
  {
36
    return ret;
37
  }
38
 
39
  virtual ATTR1 struct long_struct method1 ()
40
  {
41
    return ret;
42
  }
43
 
44
  virtual ATTR2 struct long_struct method2 ()
45
  {
46
    return ret;
47
  }
48
 
49
  virtual ATTR3 struct long_struct method3 ()
50
  {
51
    return ret;
52
  }
53
 
54
  virtual ATTR4 struct long_struct method4 ()
55
  {
56
    return ret;
57
  }
58
 
59
  virtual ATTR5 struct long_struct method5 ()
60
  {
61
    return ret;
62
  }
63
 
64
  virtual ATTR6 struct long_struct method6 ()
65
  {
66
    return ret;
67
  }
68
 
69
  virtual ATTR7 struct long_struct method7 ()
70
  {
71
    return ret;
72
  }
73
 
74
  virtual ATTR8 struct long_struct method8 ()
75
  {
76
    return ret;
77
  }
78
};
79
 
80
class c3:c1, public c2
81
{
82
public:
83
  c3 ()
84
  {
85
    this3 = this;
86
  }
87
 
88
  struct long_struct check_this (int a)
89
  {
90
    if (this3 != this)
91
      abort ();
92
 
93
    return ret;
94
  }
95
 
96
  virtual ATTR0 struct long_struct method0 ()
97
  {
98
    return check_this (0);
99
  }
100
 
101
  virtual ATTR1 struct long_struct method1 ()
102
  {
103
    return check_this (1);
104
  }
105
 
106
  virtual ATTR2 struct long_struct method2 ()
107
  {
108
    return check_this (2);
109
  }
110
 
111
  virtual ATTR3 struct long_struct method3 ()
112
  {
113
    return check_this (3);
114
  }
115
 
116
  virtual ATTR4 struct long_struct method4 ()
117
  {
118
    return check_this (4);
119
  }
120
 
121
  virtual ATTR5 struct long_struct method5 ()
122
  {
123
    return check_this (5);
124
  }
125
 
126
  virtual ATTR6 struct long_struct method6 ()
127
  {
128
    return check_this (6);
129
  }
130
 
131
  virtual ATTR7 struct long_struct method7 ()
132
  {
133
    return check_this (7);
134
  }
135
 
136
  virtual ATTR8 struct long_struct method8 ()
137
  {
138
    return check_this (7);
139
  }
140
};
141
 
142
class c3 c3_instance;
143
class c2 *c2_ptr = &c3_instance;
144
 
145
int
146
main ()
147
{
148
  c2_ptr->method0 ();
149
  c2_ptr->method1 ();
150
  c2_ptr->method2 ();
151
  c2_ptr->method3 ();
152
  c2_ptr->method4 ();
153
  c2_ptr->method5 ();
154
  c2_ptr->method6 ();
155
  c2_ptr->method7 ();
156
  c2_ptr->method8 ();
157
 
158
  return 0;
159
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.