summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/inline12.C
blob: c91845c411ee3cad0fa6bc2abed76812048e94ee (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
// { dg-do assemble  }
// { dg-options "-O2 -g" }
// (Should preferrably cycle through options.)
// Origin: Hans-Peter Nilsson <hp@axis.com>
// See <URL:http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00310.html>

typedef unsigned int    udword;
extern "C" {
void __assert (const char *, int, const char *);
}
class ShZzy;
class ShBe;
class Sh
{
 public:
  class Xy;
  inline  Sh(const char*      theName,
               const Xy& theXys);
  virtual ~Sh();
  inline const char* name() const;
  inline bool        shXy(const Xy& theXy);
  virtual void       setParent(Sh* theParent);
  class Xy
  {
   public:
    Xy(int   theXy);
    Xy(const Xy& theXy);
    Xy& operator = (const Xy&);
    bool sh(const Xy& theXy);
   private:
    int  myXyFlags;
  };
 protected:
  Xy     myXys;
 private:
  Sh();
  Sh(const Sh&);
  Sh& operator = (const Sh&);
  const char*   myName;
  Sh*         myParent;
};
class ShZzy : public Sh 
{
 public:
  inline ShZzy(const char* theName);
  inline ShZzy(const char* theName,
                   const Xy& theXys);
  virtual ~ShZzy();
  void         addShTo(char* theParent);
  virtual void ap() {}
  void         addSh(Sh* theSh);
  virtual void setParent(Sh* theParent);
  void         baseAp();
 private:
  ShZzy();
  ShZzy(const ShZzy&);
  ShZzy& operator = (const ShZzy&);
  bool          iAmInited;
};
class ShBop
{
 public:
  inline ShBop(const ShBe* theBe);
  void            shWw(bool,
                                const char* a1 = "",
                                const char* a2 = "",
                                int   a3 = -1,
                                const char* a4 = "foo");
  typedef enum { shOk,
                 shFailed,
                 shDone,
                 invalidBop } bopType;
  inline bopType bop();
  inline int        numberOfVs();
  inline void       closeBop();
 private:
  ShBop(const ShBop&);
  ShBop& operator = (const ShBop&);
  const ShBe*  myBe;
  bopType       myBop;
  int              my1;
  int              my2;
  const char*      my3;
  const char*      my4;
  int              my5;
  const char*      my6;
};
Sh::Sh(const char* theName,
           const Xy& theXys)
  :myXys(theXys),
   myName(theName),
   myParent(0)
{}
const char*
Sh::name() const
{
  return myName;
}
bool
Sh::shXy(const Xy& theXy)
{
  return myXys.sh(theXy);
}
ShZzy::ShZzy(const char* theName)
  :Sh(theName, Xy(0)),
   iAmInited(false)
{}
ShZzy::ShZzy(const char* theName,
                     const Xy& theXys)
  :Sh(theName, theXys),
   iAmInited(false)
{}
ShBop::ShBop(const ShBe* theBe)
  :myBe(theBe),
   myBop(invalidBop),
   my1(0),
   my2(0),
   my3(""),
   my4(""),
   my5(0),
   my6("")
{}
ShBop::bopType
ShBop::bop()
{
  ((!my2 || myBop == shFailed) ? (void)0 : __assert("foo", 91,"foo"));
  return myBop;
}
int
ShBop::numberOfVs()
{
  return my2 + my1;
}
void
ShBop::closeBop()
{
  if (myBop == invalidBop)
  {
    myBop = shDone;
  }
}
class ShBe;
template <class ShCc>
class ShAp : public ShZzy
{
 public:
  ShAp(const char* theName);
  ShAp(const char* theName,
                const Xy& theXys);
  virtual ~ShAp() {}
  typedef void (ShCc::*ShMethod)();
  virtual void ap() {}
 protected:
  ShBop* bop();
 private:
  ShAp();
  ShAp(const ShAp&);
  ShAp& operator = (const ShAp&);
  ShBop* myBop;
  ShBe*   myBe;
};
class ShBe : public Sh
{
 public:
  inline ShBe(const char* theName);
  inline ShBe(const char* theName,
                  const Xy& theXys);
  inline virtual ~ShBe();
  virtual void    run() = 0;
  ShBop*  runBe();
 protected:
  inline ShBop* bop();
 private:
  ShBe();
  ShBe(const ShBe&);
  ShBe& operator = (const ShBe&);
  ShBop* myBop;
};
template <class ShCc> 
ShAp<ShCc>::ShAp(const char* theName)
  : ShZzy(theName),
    myBop(0),
    myBe(0)
{}
template <class ShCc> 
ShAp<ShCc>::ShAp(const char* theName,
                                   const Sh::Xy& theXys)
  : ShZzy(theName, theXys),
    myBop(0),
    myBe(0)
{}
template <class ShCc>
ShBop*
ShAp<ShCc>::bop()
{
  ((myBop) ? (void)0 : __assert("foo", 96,"foo"));
  return myBop;
}
class xSh : public ShAp<xSh>
{
 public:
  xSh();
  virtual ~xSh();
  void ap();
  void uff();
  void rtt();
};
class xUff
{
 public:
  xUff();
  xUff(const xUff&);
  xUff& operator = (const xUff&);
  xUff(udword);
  operator udword() const;
  xUff& operator = (udword);
  bool operator < (const xUff) const;
  bool operator <= (const xUff) const;
  bool operator > (const xUff) const;
  bool operator >= (const xUff) const;
  bool operator == (const xUff) const;
  enum {size = 4};
  xUff(unsigned char* theUff);
 private:
  udword myUff;
};
inline
xUff::xUff()
  : myUff(0)
{
}
inline
xUff::xUff(udword theUff)
  : myUff(theUff)
{
}
inline
xUff::xUff(
  const xUff& theUff)
  : myUff(theUff.myUff)
{
}
inline xUff&
xUff::operator = (const xUff& theUff)
{
  myUff = theUff.myUff;
  return *this;
}
inline xUff&
xUff::operator = (udword theUff)
{
  myUff = theUff;
  return *this; 
}
inline
xUff::operator udword() const
{
  return myUff;
}
inline bool
xUff::operator < (const xUff ding) const
{
  return (((int) (myUff - ding.myUff)) < 0);
}
inline bool
xUff::operator <= (const xUff ding) const
{
  return (((int) (myUff - ding.myUff)) <= 0);
}
inline bool
xUff::operator > (const xUff ding) const
{
  return (((int) (myUff - ding.myUff)) > 0);
}
inline bool
xUff::operator >= (const xUff ding) const
{
  return (((int) (myUff - ding.myUff)) >= 0);
}
inline bool
xUff::operator == (const xUff ding) const
{
  return (myUff == ding.myUff);
}
inline
xUff::xUff(unsigned char* theUff)
{
  myUff = *(udword *)theUff;
}
void
xSh::uff()
{
  static const udword halfudword = 0x80000000;
  xUff aGah((udword)0);
  udword diagonal = halfudword + (udword) aGah;
  xUff aGeh(diagonal - 1);
  xUff aGoh(diagonal + 1);
  (bop()->shWw ((aGah.operator <=(aGah)), ("foo"), ( ""), 118, "foo"));
  (bop()->shWw ((aGah.operator >=(aGah)), ("foo"), ( ""), 119, "foo"));
  (bop()->shWw ((!(aGah.operator <(aGah))), ("foo"), ( ""), 120, "foo"));
  (bop()->shWw ((!(aGah.operator >(aGah))), ("foo"), ( ""), 121, "foo"));
  (bop()->shWw ((aGah.operator <(aGeh)), ("foo"), ( ""), 124, "foo"));
  (bop()->shWw ((aGah.operator <=(aGeh)), ("foo"), ( ""), 125, "foo"));
  (bop()->shWw ((!(aGah.operator >(aGeh))), ("foo"), ( ""), 126, "foo"));
  (bop()->shWw ((!(aGah.operator >=(aGeh))), ("foo"), ( ""), 127, "foo"));
  (bop()->shWw ((aGeh.operator >(aGah)), ("foo"), ( ""), 130, "foo"));
  (bop()->shWw ((aGeh.operator >=(aGah)), ("foo"), ( ""), 131, "foo"));
  (bop()->shWw ((!(aGeh.operator <(aGah))), ("foo"), ( ""), 132, "foo"));
  (bop()->shWw ((!(aGeh.operator <=(aGah))), ("foo"), ( ""), 133, "foo"));
  (bop()->shWw ((aGeh.operator <(aGoh)), ("foo"), ( ""), 136, "foo"));
  (bop()->shWw ((aGeh.operator <=(aGoh)), ("foo"), ( ""), 137, "foo"));
  (bop()->shWw ((!(aGeh.operator >(aGoh))), ("foo"), ( ""), 138, "foo"));
  (bop()->shWw ((!(aGeh.operator >=(aGoh))), ("foo"), ( ""), 139, "foo"));
  (bop()->shWw ((aGoh.operator >(aGeh)), ("foo"), ( ""), 142, "foo"));
  (bop()->shWw ((aGoh.operator >=(aGeh)), ("foo"), ( ""), 143, "foo"));
  (bop()->shWw ((!(aGoh.operator <(aGeh))), ("foo"), ( ""), 144, "foo"));
  (bop()->shWw ((!(aGoh.operator <=(aGeh))), ("foo"), ( ""), 145, "foo"));
  (bop()->shWw ((aGah.operator >(aGoh)), ("foo"), ( ""), 152, "foo"));
  (bop()->shWw ((aGah.operator >=(aGoh)), ("foo"), ( ""), 153, "foo"));
  (bop()->shWw ((!(aGah.operator <(aGoh))), ("foo"), ( ""), 154, "foo"));
  (bop()->shWw ((!(aGah.operator <=(aGoh))), ("foo"), ( ""), 155, "foo"));
  (bop()->shWw ((aGoh.operator <(aGah)), ("foo"), ( ""), 158, "foo"));
  (bop()->shWw ((aGoh.operator <=(aGah)), ("foo"), ( ""), 159, "foo"));
  (bop()->shWw ((!(aGoh.operator >(aGah))), ("foo"), ( ""), 160, "foo"));
  (bop()->shWw ((!(aGoh.operator >=(aGah))), ("foo"), ( ""), 161, "foo"));
}