2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / p700.C
blob5f52751639bfdf13930f9f198e8b326ae00299a4
1 // { dg-do assemble  }
2 // { dg-options "-Wno-deprecated" }
3 // { dg-error "limited range of data type" "16-bit target" { target xstormy16-*-* } 0 }
4 // prms-id: 700
6 //# 1 "../../../../libg++/etc/benchmarks/dhrystone.cc"
32 //# 1 "../../../../libg++/etc/benchmarks/Int.h" 1
108 class Int
110 protected:
111   int          rep;
115 public:
116                Int ();
117                Int (const int  b);
118                Int (const Int& b);
119               ~Int();
121                operator int() const;
123   inline virtual  int   val() const;
125   inline virtual  void  operator  = (const int);
126   inline virtual  void  operator  = (const Int&);
128   inline virtual  void  negate();
129   inline virtual  void  complement();
130   inline virtual  void  operator ++ ();
131   inline virtual  void  operator -- ();
133   inline virtual  void  operator += (const Int &  );
134   inline virtual  void  operator -= (const Int &  );
135   inline virtual  void  operator *= (const Int &  );
136   inline virtual  void  operator /= (const Int &  );
137   inline virtual  void  operator %= (const Int &  );
138   inline virtual  void  operator |= (const Int &  );
139   inline virtual  void  operator &= (const Int &  );
140   inline virtual  void  operator ^= (const Int &  );
141   inline virtual  void  operator <<=(const Int &  );
142   inline virtual  void  operator >>=(const Int &  );
145   inline virtual  void  operator += (const int);
146   inline virtual  void  operator -= (const int);
147   inline virtual  void  operator *= (const int);
148   inline virtual  void  operator /= (const int);
149   inline virtual  void  operator %= (const int);
150   inline virtual  void  operator |= (const int);
151   inline virtual  void  operator &= (const int);
152   inline virtual  void  operator ^= (const int);
153   inline virtual  void  operator <<=(const int);
154   inline virtual  void  operator >>=(const int);
159 inline  int  Int::val() const { return rep; }
160 inline       Int::operator int() const { return val(); }
162 inline       Int::Int () :rep(0) {}
163 inline       Int::Int (const int  b) :rep(b) {}
164 inline       Int::Int (const Int& b) :rep(b.Int::val()) {}
165 inline       Int::~Int() {}
167 inline  void  Int::operator  = (const int  b)
168 { rep = b;  ; }
169 inline  void  Int::operator  = (const Int&  b)
170 { rep = b.Int::val();  ; }
172 inline  void  Int::complement()
173 { rep = ~rep;  ; }
174 inline  void  Int::negate()
175 { rep = -rep;  ; }
176 inline  void  Int::operator ++ ()
177 { ++rep;  ; }
178 inline  void  Int::operator -- ()
179 { --rep;  ; }
181 inline  void  Int::operator += (const Int &   b)
182 { rep += b.Int::val();  ; }
183 inline  void  Int::operator -= (const Int &   b)
184 { rep -= b.Int::val();  ; }
185 inline  void  Int::operator *= (const Int &   b)
186 { rep *= b.Int::val();  ; }
187 inline  void  Int::operator /= (const Int &   b)
188 { rep /= b.Int::val();  ; }
189 inline  void  Int::operator %= (const Int &   b)
190 { rep %= b.Int::val();  ; }
191 inline  void  Int::operator |= (const Int &   b)
192 { rep |= b.Int::val();  ; }
193 inline  void  Int::operator &= (const Int &   b)
194 { rep &= b.Int::val();  ; }
195 inline  void  Int::operator ^= (const Int &   b)
196 { rep ^= b.Int::val();  ; }
197 inline  void  Int::operator <<=(const Int &   b)
198 { rep <<= b.Int::val();  ; }
199 inline  void  Int::operator >>=(const Int &   b)
200 { rep >>= b.Int::val();  ; }
204 inline  void  Int::operator += (const int b)
205 { rep += b;  ; }
206 inline  void  Int::operator -= (const int b)
207 { rep -= b;  ; }
208 inline  void  Int::operator *= (const int b)
209 { rep *= b;  ; }
210 inline  void  Int::operator /= (const int b)
211 { rep /= b;  ; }
212 inline  void  Int::operator %= (const int b)
213 { rep %= b;  ; }
214 inline  void  Int::operator |= (const int b)
215 { rep |= b;  ; }
216 inline  void  Int::operator &= (const int b)
217 { rep &= b;  ; }
218 inline  void  Int::operator ^= (const int b)
219 { rep ^= b;  ; }
220 inline  void  Int::operator <<=(const int b)
221 { rep <<= b;  ; }
222 inline  void  Int::operator >>=(const int b)
223 { rep >>= b;  ; }
226 inline  int& operator  = (int& a,  const Int &   b)
227 { a = b.Int::val(); return a;}  // { dg-warning "" } 
228 inline  int& operator += (int& a,  const Int &   b)
229 { a += b.Int::val(); return a; }
230 inline  int& operator -= (int& a,  const Int &   b)
231 { a -= b.Int::val(); return a;}
232 inline  int& operator *= (int& a,  const Int &   b)
233 { a *= b.Int::val(); return a;}
234 inline  int& operator /= (int& a,  const Int &   b)
235 { a /= b.Int::val(); return a;}
236 inline  int& operator %= (int& a,  const Int &   b)
237 { a %= b.Int::val(); return a;}
238 inline  int& operator |= (int& a,  const Int &   b)
239 { a |= b.Int::val(); return a;}
240 inline  int& operator &= (int& a,  const Int &   b)
241 { a &= b.Int::val(); return a;}
242 inline  int& operator ^= (int& a,  const Int &   b)
243 { a ^= b.Int::val(); return a;}
244 inline  int& operator <<=(int& a,  const Int &   b)
245 { a <<= b.Int::val(); return a;}
246 inline  int& operator >>=(int& a,  const Int &   b)
247 { a >>= b.Int::val(); return a;}
251 //# 289 "../../../../libg++/etc/benchmarks/Int.h"
254 inline  Int  operator -  (const Int &   a) return r(a) // { dg-error "" } 
255 { r.negate();  } // { dg-error "" } 
256 inline  Int  operator ~  (const Int &   a) return r(a) // { dg-error "" } 
257 { r.complement();  } // { dg-error "" } 
259 inline  Int  operator +  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
260 { r += b.Int::val();  } // { dg-error "" } 
261 inline  Int  operator -  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
262 { r -= b.Int::val();  } // { dg-error "" } 
263 inline  Int  operator *  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
264 { r *= b.Int::val();  } // { dg-error "" } 
265 inline  Int  operator /  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
266 { r /= b.Int::val();  } // { dg-error "" } 
267 inline  Int  operator %  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
268 { r %= b.Int::val();  } // { dg-error "" } 
269 inline  Int  operator << (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
270 { r <<= b.Int::val();  } // { dg-error "" } 
271 inline  Int  operator >> (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
272 { r >>= b.Int::val();  } // { dg-error "" } 
273 inline  Int  operator &  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
274 { r &= b.Int::val();  } // { dg-error "" } 
275 inline  Int  operator |  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
276 { r |= b.Int::val();  } // { dg-error "" } 
277 inline  Int  operator ^  (const Int &   a, const Int &   b) return r(a) // { dg-error "" } 
278 { r ^= b.Int::val();  } // { dg-error "" } 
280 inline  Int  operator +  (const Int &   a, const int b) return r(a) // { dg-error "" } 
281 { r += b;  } // { dg-error "" } 
282 inline  Int  operator -  (const Int &   a, const int b) return r(a) // { dg-error "" } 
283 { r -= b;  } // { dg-error "" } 
284 inline  Int  operator *  (const Int &   a, const int b) return r(a) // { dg-error "" } 
285 { r *= b;  } // { dg-error "" } 
286 inline  Int  operator /  (const Int &   a, const int b) return r(a) // { dg-error "" } 
287 { r /= b;  } // { dg-error "" } 
288 inline  Int  operator %  (const Int &   a, const int b) return r(a) // { dg-error "" } 
289 { r %= b;  } // { dg-error "" } 
290 inline  Int  operator << (const Int &   a, const int b) return r(a) // { dg-error "" } 
291 { r <<= b;  } // { dg-error "" } 
292 inline  Int  operator >> (const Int &   a, const int b) return r(a) // { dg-error "" } 
293 { r >>= b;  } // { dg-error "" } 
294 inline  Int  operator &  (const Int &   a, const int b) return r(a) // { dg-error "" } 
295 { r &= b;  } // { dg-error "" } 
296 inline  Int  operator |  (const Int &   a, const int b) return r(a) // { dg-error "" } 
297 { r |= b;  } // { dg-error "" } 
298 inline  Int  operator ^  (const Int &   a, const int b) return r(a) // { dg-error "" } 
299 { r ^= b;  } // { dg-error "" } 
301 inline  Int  operator +  (const int a, const Int &   b) return r(a) // { dg-error "" } 
302 { r += b.Int::val();  } // { dg-error "" } 
303 inline  Int  operator -  (const int a, const Int &   b) return r(a) // { dg-error "" } 
304 { r -= b.Int::val();  } // { dg-error "" } 
305 inline  Int  operator *  (const int a, const Int &   b) return r(a) // { dg-error "" } 
306 { r *= b.Int::val();  } // { dg-error "" } 
307 inline  Int  operator /  (const int a, const Int &   b) return r(a) // { dg-error "" } 
308 { r /= b.Int::val();  } // { dg-error "" } 
309 inline  Int  operator %  (const int a, const Int &   b) return r(a) // { dg-error "" } 
310 { r %= b.Int::val();  } // { dg-error "" } 
311 inline  Int  operator << (const int a, const Int &   b) return r(a) // { dg-error "" } 
312 { r <<= b.Int::val();  } // { dg-error "" } 
313 inline  Int  operator >> (const int a, const Int &   b) return r(a) // { dg-error "" } 
314 { r >>= b.Int::val();  } // { dg-error "" } 
315 inline  Int  operator &  (const int a, const Int &   b) return r(a) // { dg-error "" } 
316 { r &= b.Int::val();  } // { dg-error "" } 
317 inline  Int  operator |  (const int a, const Int &   b) return r(a) // { dg-error "" } 
318 { r |= b.Int::val();  } // { dg-error "" } 
319 inline  Int  operator ^  (const int a, const Int &   b) return r(a) // { dg-error "" } 
320 { r ^= b.Int::val();  } // { dg-error "" } 
324 inline  int  operator !  (const Int &   a) { return !a.Int::val(); }
326 inline  int  operator == (const Int &   a, const Int &   b)
327 { return a.Int::val() == b.Int::val(); }
328 inline  int  operator != (const Int &   a, const Int &   b)
329 { return a.Int::val() != b.Int::val(); }
330 inline  int  operator <  (const Int &   a, const Int &   b)
331 { return a.Int::val() <  b.Int::val(); }
332 inline  int  operator <= (const Int &   a, const Int &   b)
333 { return a.Int::val() <= b.Int::val(); }
334 inline  int  operator >  (const Int &   a, const Int &   b)
335 { return a.Int::val() >  b.Int::val(); }
336 inline  int  operator >= (const Int &   a, const Int &   b)
337 { return a.Int::val() >= b.Int::val(); }
339 inline  int  operator == (const Int &   a, const int b)
340 { return a.Int::val() == b; }
341 inline  int  operator != (const Int &   a, const int b)
342 { return a.Int::val() != b; }
343 inline  int  operator <  (const Int &   a, const int b)
344 { return a.Int::val() <  b; }
345 inline  int  operator <= (const Int &   a, const int b)
346 { return a.Int::val() <= b; }
347 inline  int  operator >  (const Int &   a, const int b)
348 { return a.Int::val() >  b; }
349 inline  int  operator >= (const Int &   a, const int b)
350 { return a.Int::val() >= b; }
352 inline  int  operator == (const int a, const Int &   b)
353 { return a == b.Int::val(); }
354 inline  int  operator != (const int a, const Int &   b)
355 { return a != b.Int::val(); }
356 inline  int  operator <  (const int a, const Int &   b)
357 { return a <  b.Int::val(); }
358 inline  int  operator <= (const int a, const Int &   b)
359 { return a <= b.Int::val(); }
360 inline  int  operator >  (const int a, const Int &   b)
361 { return a >  b.Int::val(); }
362 inline  int  operator >= (const int a, const Int &   b)
363 { return a >= b.Int::val(); }
367 //# 26 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
369 //# 1 "../../../../libg++/etc/benchmarks/Char.h" 1
447 class Char
449 protected:
450   char          rep;
454 public:
455                Char ();
456                Char (const char  b);
457                Char (const Char& b);
458               ~Char();
460                operator char() const;
462   inline virtual  char   val() const;
464   inline virtual  void  operator  = (const char);
465   inline virtual  void  operator  = (const Char&);
467   inline virtual  void  negate();
468   inline virtual  void  complement();
469   inline virtual  void  operator ++ ();
470   inline virtual  void  operator -- ();
472   inline virtual  void  operator += (const Char &  );
473   inline virtual  void  operator -= (const Char &  );
474   inline virtual  void  operator *= (const Char &  );
475   inline virtual  void  operator /= (const Char &  );
476   inline virtual  void  operator %= (const Char &  );
477   inline virtual  void  operator |= (const Char &  );
478   inline virtual  void  operator &= (const Char &  );
479   inline virtual  void  operator ^= (const Char &  );
480   inline virtual  void  operator <<=(const Char &  );
481   inline virtual  void  operator >>=(const Char &  );
484   inline virtual  void  operator += (const char);
485   inline virtual  void  operator -= (const char);
486   inline virtual  void  operator *= (const char);
487   inline virtual  void  operator /= (const char);
488   inline virtual  void  operator %= (const char);
489   inline virtual  void  operator |= (const char);
490   inline virtual  void  operator &= (const char);
491   inline virtual  void  operator ^= (const char);
492   inline virtual  void  operator <<=(const char);
493   inline virtual  void  operator >>=(const char);
498 inline  char  Char::val() const { return rep; }
499 inline       Char::operator char() const { return val(); }
501 inline       Char::Char () :rep(0) {}
502 inline       Char::Char (const char  b) :rep(b) {}
503 inline       Char::Char (const Char& b) :rep(b.Char::val()) {}
504 inline       Char::~Char() {}
506 inline  void  Char::operator  = (const char  b)
507 { rep = b;  ; }
508 inline  void  Char::operator  = (const Char&  b)
509 { rep = b.Char::val();  ; }
511 inline  void  Char::complement()
512 { rep = ~rep;  ; }
513 inline  void  Char::negate()
514 { rep = -rep;  ; }
515 inline  void  Char::operator ++ ()
516 { ++rep;  ; }
517 inline  void  Char::operator -- ()
518 { --rep;  ; }
520 inline  void  Char::operator += (const Char &   b)
521 { rep += b.Char::val();  ; }
522 inline  void  Char::operator -= (const Char &   b)
523 { rep -= b.Char::val();  ; }
524 inline  void  Char::operator *= (const Char &   b)
525 { rep *= b.Char::val();  ; }
526 inline  void  Char::operator /= (const Char &   b)
527 { rep /= b.Char::val();  ; }
528 inline  void  Char::operator %= (const Char &   b)
529 { rep %= b.Char::val();  ; }
530 inline  void  Char::operator |= (const Char &   b)
531 { rep |= b.Char::val();  ; }
532 inline  void  Char::operator &= (const Char &   b)
533 { rep &= b.Char::val();  ; }
534 inline  void  Char::operator ^= (const Char &   b)
535 { rep ^= b.Char::val();  ; }
536 inline  void  Char::operator <<=(const Char &   b)
537 { rep <<= b.Char::val();  ; }
538 inline  void  Char::operator >>=(const Char &   b)
539 { rep >>= b.Char::val();  ; }
543 inline  void  Char::operator += (const char b)
544 { rep += b;  ; }
545 inline  void  Char::operator -= (const char b)
546 { rep -= b;  ; }
547 inline  void  Char::operator *= (const char b)
548 { rep *= b;  ; }
549 inline  void  Char::operator /= (const char b)
550 { rep /= b;  ; }
551 inline  void  Char::operator %= (const char b)
552 { rep %= b;  ; }
553 inline  void  Char::operator |= (const char b)
554 { rep |= b;  ; }
555 inline  void  Char::operator &= (const char b)
556 { rep &= b;  ; }
557 inline  void  Char::operator ^= (const char b)
558 { rep ^= b;  ; }
559 inline  void  Char::operator <<=(const char b)
560 { rep <<= b;  ; }
561 inline  void  Char::operator >>=(const char b)
562 { rep >>= b;  ; }
565 inline  char& operator  = (char& a,  const Char &   b)
566 { a = b.Char::val(); return a;} // { dg-warning "" } 
567 inline  char& operator += (char& a,  const Char &   b)
568 { a += b.Char::val(); return a; }
569 inline  char& operator -= (char& a,  const Char &   b)
570 { a -= b.Char::val(); return a;}
571 inline  char& operator *= (char& a,  const Char &   b)
572 { a *= b.Char::val(); return a;}
573 inline  char& operator /= (char& a,  const Char &   b)
574 { a /= b.Char::val(); return a;}
575 inline  char& operator %= (char& a,  const Char &   b)
576 { a %= b.Char::val(); return a;}
577 inline  char& operator |= (char& a,  const Char &   b)
578 { a |= b.Char::val(); return a;}
579 inline  char& operator &= (char& a,  const Char &   b)
580 { a &= b.Char::val(); return a;}
581 inline  char& operator ^= (char& a,  const Char &   b)
582 { a ^= b.Char::val(); return a;}
583 inline  char& operator <<=(char& a,  const Char &   b)
584 { a <<= b.Char::val(); return a;}
585 inline  char& operator >>=(char& a,  const Char &   b)
586 { a >>= b.Char::val(); return a;}
590 //# 291 "../../../../libg++/etc/benchmarks/Char.h"
593 inline  Char  operator -  (const Char &   a) return r(a) // { dg-error "" } 
594 { r.negate();  } // { dg-error "" } 
595 inline  Char  operator ~  (const Char &   a) return r(a) // { dg-error "" } 
596 { r.complement();  } // { dg-error "" } 
598 inline  Char  operator +  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
599 { r += b.Char::val();  } // { dg-error "" } 
600 inline  Char  operator -  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
601 { r -= b.Char::val();  } // { dg-error "" } 
602 inline  Char  operator *  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
603 { r *= b.Char::val();  } // { dg-error "" } 
604 inline  Char  operator /  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
605 { r /= b.Char::val();  } // { dg-error "" } 
606 inline  Char  operator %  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
607 { r %= b.Char::val();  } // { dg-error "" } 
608 inline  Char  operator << (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
609 { r <<= b.Char::val();  } // { dg-error "" } 
610 inline  Char  operator >> (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
611 { r >>= b.Char::val();  } // { dg-error "" } 
612 inline  Char  operator &  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
613 { r &= b.Char::val();  } // { dg-error "" } 
614 inline  Char  operator |  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
615 { r |= b.Char::val();  } // { dg-error "" } 
616 inline  Char  operator ^  (const Char &   a, const Char &   b) return r(a) // { dg-error "" } 
617 { r ^= b.Char::val();  } // { dg-error "" } 
619 inline  Char  operator +  (const Char &   a, const char b) return r(a) // { dg-error "" } 
620 { r += b;  } // { dg-error "" } 
621 inline  Char  operator -  (const Char &   a, const char b) return r(a) // { dg-error "" } 
622 { r -= b;  } // { dg-error "" } 
623 inline  Char  operator *  (const Char &   a, const char b) return r(a) // { dg-error "" } 
624 { r *= b;  } // { dg-error "" } 
625 inline  Char  operator /  (const Char &   a, const char b) return r(a) // { dg-error "" } 
626 { r /= b;  } // { dg-error "" } 
627 inline  Char  operator %  (const Char &   a, const char b) return r(a) // { dg-error "" } 
628 { r %= b;  } // { dg-error "" } 
629 inline  Char  operator << (const Char &   a, const char b) return r(a) // { dg-error "" } 
630 { r <<= b;  } // { dg-error "" } 
631 inline  Char  operator >> (const Char &   a, const char b) return r(a) // { dg-error "" } 
632 { r >>= b;  } // { dg-error "" } 
633 inline  Char  operator &  (const Char &   a, const char b) return r(a) // { dg-error "" } 
634 { r &= b;  } // { dg-error "" } 
635 inline  Char  operator |  (const Char &   a, const char b) return r(a) // { dg-error "" } 
636 { r |= b;  } // { dg-error "" } 
637 inline  Char  operator ^  (const Char &   a, const char b) return r(a) // { dg-error "" } 
638 { r ^= b;  } // { dg-error "" } 
640 inline  Char  operator +  (const char a, const Char &   b) return r(a) // { dg-error "" } 
641 { r += b.Char::val();  } // { dg-error "" } 
642 inline  Char  operator -  (const char a, const Char &   b) return r(a) // { dg-error "" } 
643 { r -= b.Char::val();  } // { dg-error "" } 
644 inline  Char  operator *  (const char a, const Char &   b) return r(a) // { dg-error "" } 
645 { r *= b.Char::val();  } // { dg-error "" } 
646 inline  Char  operator /  (const char a, const Char &   b) return r(a) // { dg-error "" } 
647 { r /= b.Char::val();  } // { dg-error "" } 
648 inline  Char  operator %  (const char a, const Char &   b) return r(a) // { dg-error "" } 
649 { r %= b.Char::val();  } // { dg-error "" } 
650 inline  Char  operator << (const char a, const Char &   b) return r(a) // { dg-error "" } 
651 { r <<= b.Char::val();  } // { dg-error "" } 
652 inline  Char  operator >> (const char a, const Char &   b) return r(a) // { dg-error "" } 
653 { r >>= b.Char::val();  } // { dg-error "" } 
654 inline  Char  operator &  (const char a, const Char &   b) return r(a) // { dg-error "" } 
655 { r &= b.Char::val();  } // { dg-error "" } 
656 inline  Char  operator |  (const char a, const Char &   b) return r(a) // { dg-error "" } 
657 { r |= b.Char::val();  } // { dg-error "" } 
658 inline  Char  operator ^  (const char a, const Char &   b) return r(a) // { dg-error "" } 
659 { r ^= b.Char::val();  } // { dg-error "" } 
663 inline  char  operator !  (const Char &   a) { return !a.Char::val(); }
665 inline  char  operator == (const Char &   a, const Char &   b)
666 { return a.Char::val() == b.Char::val(); }
667 inline  char  operator != (const Char &   a, const Char &   b)
668 { return a.Char::val() != b.Char::val(); }
669 inline  char  operator <  (const Char &   a, const Char &   b)
670 { return a.Char::val() <  b.Char::val(); }
671 inline  char  operator <= (const Char &   a, const Char &   b)
672 { return a.Char::val() <= b.Char::val(); }
673 inline  char  operator >  (const Char &   a, const Char &   b)
674 { return a.Char::val() >  b.Char::val(); }
675 inline  char  operator >= (const Char &   a, const Char &   b)
676 { return a.Char::val() >= b.Char::val(); }
678 inline  char  operator == (const Char &   a, const char b)
679 { return a.Char::val() == b; }
680 inline  char  operator != (const Char &   a, const char b)
681 { return a.Char::val() != b; }
682 inline  char  operator <  (const Char &   a, const char b)
683 { return a.Char::val() <  b; }
684 inline  char  operator <= (const Char &   a, const char b)
685 { return a.Char::val() <= b; }
686 inline  char  operator >  (const Char &   a, const char b)
687 { return a.Char::val() >  b; }
688 inline  char  operator >= (const Char &   a, const char b)
689 { return a.Char::val() >= b; }
691 inline  char  operator == (const char a, const Char &   b)
692 { return a == b.Char::val(); }
693 inline  char  operator != (const char a, const Char &   b)
694 { return a != b.Char::val(); }
695 inline  char  operator <  (const char a, const Char &   b)
696 { return a <  b.Char::val(); }
697 inline  char  operator <= (const char a, const Char &   b)
698 { return a <= b.Char::val(); }
699 inline  char  operator >  (const char a, const Char &   b)
700 { return a >  b.Char::val(); }
701 inline  char  operator >= (const char a, const Char &   b)
702 { return a >= b.Char::val(); }
706 //# 27 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
990 //# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1
993 //# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
995 extern "C" {
996 //# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
1027 typedef int ptrdiff_t;
1049 typedef int size_t;
1090 //# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
1093 //# 73 "/giga/hgs/lib/g++-include/stddef.h"
1095 //# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2
1100 extern "C"
1128 //# 1 "/usr/include/sys/types.h" 1
1144 //# 1 "/usr/include/sys/stdtypes.h" 1
1158 typedef int             sigset_t;
1160 typedef unsigned int    speed_t;
1161 typedef unsigned long   tcflag_t;
1162 typedef unsigned char   cc_t;
1163 typedef int             pid_t;
1165 typedef unsigned short  mode_t;
1166 typedef short           nlink_t;
1168 typedef long            clock_t;
1169 typedef long            time_t;
1171 typedef int             size_t;
1172 typedef int             ptrdiff_t;
1175 //# 16 "/usr/include/sys/types.h" 2
1179 //# 1 "/usr/include/sys/sysmacros.h" 1
1199 //# 19 "/usr/include/sys/types.h" 2
1205 typedef unsigned char   u_char;
1206 typedef unsigned short  u_short;
1207 typedef unsigned int    u_int;
1208 typedef unsigned long   u_long;
1209 typedef unsigned short  ushort;
1210 typedef unsigned int    uint;
1226 typedef struct  _physadr_t { int r[1]; } *physadr_t;
1227 typedef struct label_t {
1228         int     val[2];
1229 } label_t;
1237 typedef struct  _quad_t { long val[2]; } quad_t;
1238 typedef long    daddr_t;
1239 typedef char *  caddr_t;
1240 typedef unsigned long   ino_t;
1241 typedef short   dev_t;
1242 typedef long    off_t;
1243 typedef unsigned short  uid_t;
1244 typedef unsigned short  gid_t;
1245 typedef long    key_t;
1246 typedef char *  addr_t;
1261 typedef long    fd_mask;
1271 typedef struct fd_set {
1272         fd_mask fds_bits[(((256 )+(( (sizeof (fd_mask) * 8              )       )-1))/( (sizeof (fd_mask) * 8           )       )) ];
1273 } fd_set;
1281 //# 113 "/usr/include/sys/types.h"
1285 //# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2
1324 //# 310 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
1326 //# 1 "/giga/hgs/lib/g++-include/sys/times.h" 1
1327 //# 1 "/giga/hgs/lib/g++-include/time.h" 1
1333 //# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
1335 extern "C" {
1336 //# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
1337 //# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h"
1339 //# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
1342 //# 73 "/giga/hgs/lib/g++-include/stddef.h"
1344 //# 6 "/giga/hgs/lib/g++-include/time.h" 2
1346 //# 1 "/giga/hgs/lib/g++-include/stdio.h" 1
1395 //#pragma interface
1415 //# 80 "/giga/hgs/lib/g++-include/stdio.h"
1419 //# 117 "/giga/hgs/lib/g++-include/stdio.h"
1425 //# 153 "/giga/hgs/lib/g++-include/stdio.h"
1429 extern "C" {
1458 //# 1 "/usr/include/stdio.h" 1
1464 extern  struct  _iobuf {
1465         int     _cnt;
1466         unsigned char *_ptr;
1467         unsigned char *_base;
1468         int     _bufsiz;
1469         short   _flag;
1470         char    _file;
1471 } _iob[];
1511 extern struct _iobuf    *c_proto_fopen ();
1512 extern struct _iobuf    *c_proto_fdopen ();
1513 extern struct _iobuf    *c_proto_freopen ();
1514 extern struct _iobuf    *c_proto_popen ();
1515 extern struct _iobuf    *tmpfile();
1516 extern long     ftell(_iobuf *);
1517 extern char     *fgets(char *, int, _iobuf *);
1518 extern char     *gets(char *);
1519 extern char     *c_proto_sprintf ();
1520 extern char     *ctermid();
1521 extern char     *cuserid();
1522 extern char     *c_proto_tempnam ();
1523 extern char     *tmpnam();
1530 //# 185 "/giga/hgs/lib/g++-include/stdio.h" 2
1563 //# 417 "/giga/hgs/lib/g++-include/stdio.h"
1570 extern "C" {
1578 int    _doprnt(const char*, void*, struct _iobuf *);
1579 int    _doscan(struct _iobuf *, const char*, ...);
1580 int    _filbuf(struct _iobuf *);
1581 int    _flsbuf(unsigned, struct _iobuf *);
1583 int    fclose(struct _iobuf *);
1584 struct _iobuf *  fdopen(int, const char*);
1585 int    fflush(struct _iobuf *);
1586 int    fgetc(struct _iobuf *);
1587 char*  fgets(char*, int, struct _iobuf  *);
1588 struct _iobuf *  fopen(const char*, const char*);
1589 int    fprintf(struct _iobuf *, const char* ...);
1590 int    fputc(int, struct _iobuf *);
1591 int    fputs(const char*, struct _iobuf *);
1592 int fread(void*, int, int, struct _iobuf *);
1596 struct _iobuf *  freopen(const char*, const char*, struct _iobuf *);
1598 int    fscanf(struct _iobuf *, const char* ...);
1599 int    fseek(struct _iobuf *, long, int);
1600 long   ftell(struct _iobuf  *);
1601 int fwrite(const void*, int, int, struct _iobuf *);
1602 char*  gets(char*);
1603 int    getw(struct _iobuf *);
1604 int    pclose(struct _iobuf *);
1605 void   perror(const char*);
1606 struct _iobuf *  popen(const char*, const char*);
1607 int    printf(const char* ...);
1608 int    puts(const char*);
1609 int    putw(int, struct _iobuf *);
1610 int    rewind(struct _iobuf *);
1611 int    scanf(const char* ...);
1612 int    setbuf(struct _iobuf *, char*);
1613 int    setbuffer(struct _iobuf *, char*, int);
1614 int    setlinebuf(struct _iobuf *);
1615 int    setvbuf(struct _iobuf *, char*, int, int);
1616 int    sscanf(char*, const char* ...);
1617 struct _iobuf *  tmpfile();
1618 int    ungetc(int, struct _iobuf *);
1619 int    vfprintf(struct _iobuf *, const char*, ...);
1624 int    vprintf(const char*, ... );
1630 int  sprintf(char*, const char*, ...);
1631 char*  vsprintf(char*, const char*, ...);
1652 //# 7 "/giga/hgs/lib/g++-include/time.h" 2
1655 //# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1
1658 //# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
1660 extern "C" {
1661 //# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
1662 //# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h"
1664 //# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
1667 //# 73 "/giga/hgs/lib/g++-include/stddef.h"
1669 //# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2
1674 extern "C"
1702 //# 1 "/usr/include/sys/types.h" 1
1711 //# 115 "/usr/include/sys/types.h"
1713 //# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2
1752 //# 9 "/giga/hgs/lib/g++-include/time.h" 2
1755 extern "C" {
1773 //# 42 "/giga/hgs/lib/g++-include/time.h"
1781 //# 1 "/usr/include/time.h" 1
1787 //# 1 "/usr/include/sys/stdtypes.h" 1
1798 //# 32 "/usr/include/sys/stdtypes.h"
1800 //# 6 "/usr/include/time.h" 2
1805 struct  tm {
1806         int     tm_sec;
1807         int     tm_min;
1808         int     tm_hour;
1809         int     tm_mday;
1810         int     tm_mon;
1811         int     tm_year;
1812         int     tm_wday;
1813         int     tm_yday;
1814         int     tm_isdst;
1815         char    *tm_zone;
1816         long    tm_gmtoff;
1819 extern  struct tm *c_proto_gmtime (), *c_proto_localtime ();
1820 extern  char *c_proto_asctime (), *c_proto_ctime ();
1821 extern  void c_proto_tzset (), c_proto_tzsetwall ();
1822 extern  int dysize(int);
1823 extern  time_t timelocal(), timegm();
1826 //# 49 "/giga/hgs/lib/g++-include/time.h" 2
1829 //# 1 "/usr/include/sys/times.h" 1
1839 //# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1
1842 //# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
1844 extern "C" {
1845 //# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
1846 //# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h"
1848 //# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
1851 //# 73 "/giga/hgs/lib/g++-include/stddef.h"
1853 //# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2
1858 extern "C"
1886 //# 1 "/usr/include/sys/types.h" 1
1895 //# 115 "/usr/include/sys/types.h"
1897 //# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2
1936 //# 10 "/usr/include/sys/times.h" 2
1939 struct tms {
1940         clock_t tms_utime;
1941         clock_t tms_stime;
1942         clock_t tms_cutime;
1943         clock_t tms_cstime;
1947 clock_t times(tms * );
1951 //# 51 "/giga/hgs/lib/g++-include/time.h" 2
1973 extern struct tm* localtime(long*);
1974 extern struct tm* gmtime(long*);
1975 extern char* ctime(long*);
1976 extern char* asctime(struct tm*);
1977 extern void tzset();
1978 extern void tzsetwall();
1985 extern long times(struct tms*);
1988 //# 97 "/giga/hgs/lib/g++-include/time.h"
1990 extern char* timezone(int, int);
1991 extern int getitimer(int, struct itimerval*);
1992 extern int setitimer(int, struct itimerval*, struct itimerval*);
1993 extern int gettimeofday(struct timeval*, struct timezone*);
1994 extern int settimeofday(struct timeval*, struct timezone*);
1995 extern int stime(long*);
1996 int       dysize(int);
2005 long      clock(void);
2007 long      time(long*);
2008 unsigned  ualarm(unsigned, unsigned);
2009 unsigned  usleep(unsigned);
2010 int       profil(char*, int, int, int);
2016 //# 1 "/giga/hgs/lib/g++-include/sys/times.h" 2
2018 //# 311 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
2043 typedef enum    {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration;
2048 typedef Int     OneToThirty;
2049 typedef Int     OneToFifty;
2050 typedef Char    CapitalLetter;
2051 typedef Char    String30[31];
2052 typedef Int     Array1Dim[51];
2053 typedef Int     Array2Dim[51][51];
2055 struct  Record
2057         struct Record           *PtrComp;
2058         Enumeration             Discr;
2059         Enumeration             EnumComp;
2060         OneToFifty              IntComp;
2061         String30                StringComp;
2064 typedef struct Record   RecordType;
2065 typedef RecordType *    RecordPtr;
2066 typedef int             boolean;
2078 extern "C" {
2079 extern int printf(const char* ...);
2080 extern void exit(int);
2083 void Proc0();
2084 void Proc1(RecordPtr PtrParIn);
2085 void Proc2(OneToFifty   *IntParIO);
2086 void Proc3(RecordPtr    *PtrParOut);
2087 void Proc4();
2088 void Proc5();
2089 boolean Func3(Enumeration       EnumParIn);
2090 void Proc6(  Enumeration        EnumParIn,   Enumeration        *EnumParOut);
2091 void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty *IntParOut);
2092 void Proc8(Array1Dim    Array1Par,
2093       Array2Dim Array2Par,
2094       OneToFifty IntParI1,
2095       OneToFifty IntParI2);
2096 Enumeration Func1(CapitalLetter CharPar1, CapitalLetter CharPar2);
2097 boolean Func2(String30  StrParI1, String30      StrParI2);
2098 boolean Func3(Enumeration       EnumParIn);
2100 void mystrcpy(String30 s, char* t)
2102   for (; *t != '\0'; ++s, ++t) *s = *t;
2103   *s = '\0';
2106 char mystrcmp(String30 s, String30 t)
2108   for (; *s == *t; ++s, ++t) if (*s == '\0') return 0;
2109   return char(*s - *t);
2114 main()
2116         Proc0();
2117         exit(0);
2123 Int             IntGlob;
2124 boolean         BoolGlob;
2125 char            Char1Glob;
2126 char            Char2Glob;
2127 Array1Dim       Array1Glob;
2128 Array2Dim       Array2Glob;
2129 RecordPtr       PtrGlb;
2130 RecordPtr       PtrGlbNext;
2132 void Proc0()
2134         OneToFifty              IntLoc1;
2135           OneToFifty            IntLoc2;
2136         OneToFifty              IntLoc3;
2137           char          CharLoc;
2138           char          CharIndex;
2139         Enumeration             EnumLoc;
2140         String30                String1Loc;
2141         String30                String2Loc;
2143 //# 445 "../../../../libg++/etc/benchmarks/dhrystone.cc"
2146         time_t                  starttime;
2147         time_t                  benchtime;
2148         time_t                  nulltime;
2149         struct tms              Tms;
2150         register unsigned int   i;
2152         times(&Tms); starttime = Tms.tms_utime;
2153         for (i = 0; i < 500000          ; ++i);
2154         times(&Tms);
2155         nulltime = Tms.tms_utime - starttime;
2158         PtrGlbNext = new Record;
2159         PtrGlb = new Record;
2160         PtrGlb->PtrComp = PtrGlbNext;
2161         PtrGlb->Discr = Ident1;
2162         PtrGlb->EnumComp = Ident3;
2163         PtrGlb->IntComp = 40;
2164         mystrcpy(PtrGlb->StringComp, "DHRYSTONE PROGRAM, SOME STRING");
2165         mystrcpy(String1Loc, "JUST INITIALIZED TO SOME JUNK.");
2174         times(&Tms); starttime = Tms.tms_utime;
2176         for (i = 0; i < 500000          ; ++i)
2177         {
2179                 Proc5();
2180                 Proc4();
2181                 IntLoc1 = 2;
2182                 IntLoc2 = 3;
2183                 mystrcpy(String2Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
2184                 EnumLoc = Ident2;
2185                 BoolGlob = ! Func2(String1Loc, String2Loc);
2186                 while (IntLoc1 < IntLoc2)
2187                 {
2188                         IntLoc3 = 5 * IntLoc1 - IntLoc2;
2189                         Proc7(IntLoc1, IntLoc2, &IntLoc3);
2190                         ++IntLoc1;
2191                 }
2192                 Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3);
2193                 Proc1(PtrGlb);
2194                 for (CharIndex = 'A'; CharIndex <= Char2Glob; ++CharIndex)
2195                         if (EnumLoc == Func1(CharIndex, 'C'))
2196                                 Proc6(Ident1, &EnumLoc);
2197                 IntLoc3 = IntLoc2 * IntLoc1;
2198                 IntLoc2 = IntLoc3 / IntLoc1;
2199                 IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1;
2200                 Proc2(&IntLoc1);
2201         }
2215         times(&Tms);
2216         benchtime = Tms.tms_utime - starttime - nulltime;
2217         printf("Dhrystone time for %ld passes = %ld\n",
2218                 (long) 500000           , benchtime/60          );
2219         printf("This machine benchmarks at %ld dhrystones/second\n",
2220                 ((long) 500000          ) * 60           / benchtime);
2225 void Proc1(RecordPtr PtrParIn)
2229         (*(PtrParIn->PtrComp))  =  *PtrGlb ;
2230         PtrParIn->IntComp = 5;
2231         (*(PtrParIn->PtrComp)) .IntComp = PtrParIn->IntComp;
2232         (*(PtrParIn->PtrComp)) .PtrComp = PtrParIn->PtrComp;
2234         Proc3(&((*(PtrParIn->PtrComp)) .PtrComp));
2235         if ((*(PtrParIn->PtrComp)) .Discr == Ident1)
2236         {
2237                 (*(PtrParIn->PtrComp)) .IntComp = 6;
2238                 Proc6(PtrParIn->EnumComp, &(*(PtrParIn->PtrComp)) .EnumComp);
2239                 (*(PtrParIn->PtrComp)) .PtrComp = PtrGlb->PtrComp;
2240                 Proc7((*(PtrParIn->PtrComp)) .IntComp, 10, &(*(PtrParIn->PtrComp)) .IntComp);
2241         }
2242         else
2243                 *PtrParIn =  (*(PtrParIn->PtrComp))  ;
2248 void Proc2(OneToFifty   *IntParIO)
2250           OneToFifty            IntLoc;
2251           Enumeration           EnumLoc;
2253         IntLoc = *IntParIO + 10;
2254         for(;;)
2255         {
2256                 if (Char1Glob == 'A')
2257                 {
2258                         --IntLoc;
2259                         *IntParIO = IntLoc - IntGlob;
2260                         EnumLoc = Ident1;
2261                 }
2262                 if (EnumLoc == Ident1)
2263                         break;
2264         }
2267 void Proc3(RecordPtr    *PtrParOut)
2269         if (PtrGlb != 0 )
2270                 *PtrParOut = PtrGlb->PtrComp;
2271         else
2272                 IntGlob = 100;
2273         Proc7(10, IntGlob, &PtrGlb->IntComp);
2276 void Proc4()
2278           boolean       BoolLoc;
2280         BoolLoc = Char1Glob == 'A';
2281         BoolLoc |= BoolGlob;
2282         Char2Glob = 'B';
2285 void Proc5()
2287         Char1Glob = 'A';
2288         BoolGlob =      0 ;
2294 void Proc6(  Enumeration        EnumParIn,   Enumeration        *EnumParOut)
2296         *EnumParOut = EnumParIn;
2297         if (! Func3(EnumParIn) )
2298                 *EnumParOut = Ident4;
2299         switch (EnumParIn)
2300         {
2301         case Ident1:    *EnumParOut = Ident1; break;
2302         case Ident2:    if (IntGlob > 100) *EnumParOut = Ident1;
2303                         else *EnumParOut = Ident4;
2304                         break;
2305         case Ident3:    *EnumParOut = Ident2; break;
2306         case Ident4:    break;
2307         case Ident5:    *EnumParOut = Ident3;
2308         }
2311 void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty *IntParOut)
2313           OneToFifty    IntLoc;
2315         IntLoc = IntParI1 + 2;
2316         *IntParOut = IntParI2 + IntLoc;
2319 void Proc8(Array1Dim    Array1Par,
2320       Array2Dim Array2Par,
2321       OneToFifty IntParI1,
2322       OneToFifty IntParI2)
2324           OneToFifty    IntLoc;
2325           OneToFifty    IntIndex;
2327         IntLoc = IntParI1 + 5;
2328         Array1Par[IntLoc] = IntParI2;
2329         Array1Par[IntLoc+1] = Array1Par[IntLoc];
2330         Array1Par[IntLoc+30] = IntLoc;
2331         for (IntIndex = IntLoc; IntIndex <= (IntLoc+1); ++IntIndex)
2332                 Array2Par[IntLoc][IntIndex] = IntLoc;
2333         ++Array2Par[IntLoc][IntLoc-1];
2334         Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc];
2335         IntGlob = 5;
2338 Enumeration Func1(CapitalLetter CharPar1, CapitalLetter CharPar2)
2340           CapitalLetter CharLoc1;
2341           CapitalLetter CharLoc2;
2343         CharLoc1 = CharPar1;
2344         CharLoc2 = CharLoc1;
2345         if (CharLoc2 != CharPar2)
2346                 return (Ident1);
2347         else
2348                 return (Ident2);
2351 boolean Func2(String30  StrParI1, String30      StrParI2)
2353           OneToThirty           IntLoc;
2354           CapitalLetter CharLoc;
2356         IntLoc = 1;
2357         while (IntLoc <= 1)
2358                 if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1)
2359                 {
2360                         CharLoc = 'A';
2361                         ++IntLoc;
2362                 }
2363         if (CharLoc >= 'W' && CharLoc <= 'Z')
2364                 IntLoc = 7;
2365         if (CharLoc == 'X')
2366                 return( 1 );
2367         else
2368         {
2369                 if (mystrcmp(StrParI1, StrParI2) > 0)
2370                 {
2371                         IntLoc += 7;
2372                         return (        1 );
2373                 }
2374                 else
2375                         return (        0 );
2376         }
2379 boolean Func3(Enumeration       EnumParIn)
2381           Enumeration   EnumLoc;
2383         EnumLoc = EnumParIn;
2384         if (EnumLoc == Ident3) return ( 1 );
2385         return (        0 );