Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.pt / tiemann2.C
blob2b1a12f88bf88d4df21f43a1e38c6a6af8cb716c
1 // { dg-do run  }
2 extern "C" int printf (const char *, ...);
3 template <class T> T max (const T&x, const T&y)
5   return (x>y)?x:y;
8 class complex
10   double re, im;
11  public:
12   complex (double r, double i=0) { re = r; im = i; }
13   friend int operator > (const complex& x, const complex &y);
14   void print () { printf ("re = %g; im = %g;\n", re, im); }
16 int operator >(const complex& x, const complex &y)
18   double c1 = x.re * x.re + x.im * x.im;
19   double c2 = y.re * y.re + y.im * y.im;
20   return c1 > c2;
23 int main ()
25   complex c1 (1, 0);
26   complex c2 (2, 0);
27   complex c3 (2, 3);
28   complex c4 (2, 1);
30   complex m1 = max (c1, c2);
31   complex m2 = max (c3, c4);
32   m1.print ();
33   m2.print ();
34   return 0;