Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / eh / delayslot1.C
blobddc960e6d8b06c69ba94ee9923f06d5a106c693e
1 // PR target/12301
2 // Origin: Colin Hirsch <gcc@cohi.at>
3 // Testcase by Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
5 // This used to fail on SPARC because the reorg pass moved an insn
6 // across a function call that can throw internally, in order to put
7 // it in a delay slot.
9 // { dg-do run }
10 // { dg-options "-O" }
12 struct S{
13   char *c;
14   char data[100];
15   S () : c (data) {};
16   S (const S& s) {
17     c = data;
18     data[0] = s.c[0];
19   }
22 S real_cast ()
24   throw 3;  
27 S cast_helper(S& debug)
29   try {
30     return real_cast();
31   }
32   catch (int e) {
33     throw debug;
34   }
37 int main()
39   S tmp;
41   try {
42     cast_helper (tmp);
43   }                                        
44   catch (S& e) {}
46   return 0;