Add an UNSPEC_PROLOGUE_USE to prevent the link register from being considered dead.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / ctors12.C
blob0d81ced4455651c5ff1fc4131b5a953a5230c30d
1 // GROUPS passed constructors
2 #include <cstdio>
3 #include <cstdlib>
4 #include <iostream>
6 #define MAGIC 7654
8 class complex {
9         double re;
10         double im;
11         int magic;
12         static int count;
13 public:
14         complex() { re=im=0; magic=MAGIC; }
15         complex(double d) { re=d; im=0; magic=MAGIC; }
16         complex(double d, double d2) {re=d; im=d2; magic=MAGIC; }
17         ~complex() {if(magic!=MAGIC) {std::printf("FAIL\n"); std::exit(1);}}
18         friend std::ostream& operator << (std::ostream& o, const complex& c)
19         { return o << "(" << c.re << "," << c.im << ")"; }
22 int complex::count=0;
24 int main()
26         complex v[6] = {1, complex(1,2), complex(), 2 }; // ARM Sect. 12.6.1
27         int i;                                           // page 289
29         for(i=0; i<6; i++) ;
30         std::printf ("PASS\n");
32         return 0;