* gcc.dg/i386-sse-5.c: New test
[official-gcc.git] / gcc / testsuite / g++.dg / eh / simd-1.C
blob2be5e63cba4946049b4fe3d6beca0fe952d1f23a
1 // Test EH when V2SI 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-do run }
6 // { dg-error "" "PR target/12916" { target sparc*-*-* } 10 }
8 typedef int __attribute__((mode(V2SI))) vecint;
10 vecint vecfunc (vecint beachbum)
12   return beachbum;
15 void f3 (void)
17   /* Force a use of a V2SI register if available.  On the PPC/E500,
18      this will cause the compiler to save the registers in this
19      function in 64-bits.  */
20   vecint foobar = (vecint) {0, 0};
21   foobar = vecfunc (foobar);
23   throw int();
26 void f2 (void)
28   vecint foobar = (vecint) {0, 0};
29   foobar = vecfunc (foobar);
31   f3 ();
34 void f1 (void)
36   int i;
37   try
38     {
39       f2 ();
40     }
41   catch (int)
42     {
43       i = 9;
44     }
47 int main ()
49   f1 ();
50   return 0;