Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.dg / eh / simd-2.C
blob9d9dce509bd8ae00d933128806ed013034427272
1 // Test EH when V4SI SIMD registers are involved.
2 // Contributed by Aldy Hernandez (aldy@quesejoda.com).
3 // { dg-options "-O" }
4 // { dg-options "-O -w" { target i?86-*-* } }
5 // { dg-options "-O -w -maltivec" { target powerpc*-*-linux* } }
6 // { dg-do run }
8 #include "check-vect.h"
10 typedef int __attribute__((vector_size (16))) vecint;
12 vecint vecfunc (vecint beachbum)
14   return beachbum;
17 void f3 (void)
19   vecint foobar = (vecint) {0, 0};
20   foobar = vecfunc (foobar);
22   throw int();
25 void f2 (void)
27   vecint foobar = (vecint) {0, 0};
28   foobar = vecfunc (foobar);
30   f3 ();
33 void f1 (void)
35   int i;
36   try
37     {
38       f2 ();
39     }
40   catch (int)
41     {
42       i = 9;
43     }
46 int main ()
48   /* Exit with zero if the hardware does not support AltiVec instructions.  */
49   check_vect ();
50   f1 ();
51   return 0;