OSDN Git Service

* g++.dg/eh/forced1.C: Use _Unwind_SjLj_ForcedUnwind as appropriate.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / eh / simd-1.C
1 // Test EH when V2SI SIMD registers are involved.
2 // Contributed by Aldy Hernandez (aldy@quesejoda.com).
3 // { dg-options "-O" }
4 // { dg-do run }
5
6 typedef int __attribute__((mode(V2SI))) vecint;
7
8 vecint vecfunc (vecint beachbum)
9 {
10   return beachbum;
11 }
12
13 void f3 (void)
14 {
15   /* Force a use of a V2SI register if available.  On the PPC/E500,
16      this will cause the compiler to save the registers in this
17      function in 64-bits.  */
18   vecint foobar = (vecint) {0, 0};
19   foobar = vecfunc (foobar);
20
21   throw int();
22 }
23
24 void f2 (void)
25 {
26   vecint foobar = (vecint) {0, 0};
27   foobar = vecfunc (foobar);
28
29   f3 ();
30 }
31
32 void f1 (void)
33 {
34   int i;
35   try
36     {
37       f2 ();
38     }
39   catch (int)
40     {
41       i = 9;
42     }
43 }
44
45 int main ()
46 {
47   f1 ();
48   return 0;
49 }