OSDN Git Service

a6f2a3fabc1ca702857d6a64a71e8d827bce8034
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / eh / simd-2.C
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-*-* x86_64-*-* } && ilp32 } } }
5 // { dg-options "-O -w -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } }
6 // { dg-xfail-if "" { "powerpc-*-eabispe*" "powerpc-ibm-aix*" } { "*" } { "" } }
7 // { dg-do run }
8
9 #include "check-vect.h"
10
11 typedef int __attribute__((vector_size (16))) vecint;
12
13 vecint vecfunc (vecint beachbum)
14 {
15   return beachbum;
16 }
17
18 void f3 (void)
19 {
20   vecint foobar = (vecint) {0, 0};
21   foobar = vecfunc (foobar);
22
23   throw int();
24 }
25
26 void f2 (void)
27 {
28   vecint foobar = (vecint) {0, 0};
29   foobar = vecfunc (foobar);
30
31   f3 ();
32 }
33
34 void f1 (void)
35 {
36   int i;
37   try
38     {
39       f2 ();
40     }
41   catch (int)
42     {
43       i = 9;
44     }
45 }
46
47 int main ()
48 {
49   /* Exit with zero if the hardware does not support AltiVec instructions.  */
50   check_vect ();
51   f1 ();
52   return 0;
53 }