2003-04-02 Aldy Hernandez <aldyh@redhat.com>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / simd-1.C
blob1e15b4d5d1af933441ca829625a336666565f41d
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 }
6 typedef int __attribute__((mode(V2SI))) vecint;
8 vecint vecfunc (vecint beachbum)
10   return beachbum;
13 void f3 (void)
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);
21   throw int();
24 void f2 (void)
26   vecint foobar = (vecint) {0, 0};
27   foobar = vecfunc (foobar);
29   f3 ();
32 void f1 (void)
34   int i;
35   try
36     {
37       f2 ();
38     }
39   catch (int)
40     {
41       i = 9;
42     }
45 int main ()
47   f1 ();
48   return 0;