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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [other/] [pr35504.C] - Blame information for rev 301

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

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

powered by: WebSVN 2.1.0

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