Debian Codegraph @

gcc/testsuite/g++.dg/eh/simd-3.C

raw
1 // { dg-options "-O" }
2 // { dg-options "-O -maltivec" { target { powerpc*-*-darwin* && powerpc_altivec_ok } } }
3 // { dg-do run }
4 // { dg-skip-if "requires hosted libstdc++ for cstring" { ! hostedlib } }
5
6 #include <cstdlib>
7 #include <cstring>
8
9 typedef int __attribute__((vector_size(16))) v;
10
11 v vv[32];
12 volatile v vt = { 1, 2, 3, 4 };
13
14 void clobber_vrs(void) { };
15
16 void (*volatile fp)() = clobber_vrs;
17
18 void thrower(void)
19 {
20 v v00 = vv[ 0];
21 v v01 = vv[ 1];
22 v v02 = vv[ 2];
23 v v03 = vv[ 3];
24 v v04 = vv[ 4];
25 v v05 = vv[ 5];
26 v v06 = vv[ 6];
27 v v07 = vv[ 7];
28 v v08 = vv[ 8];
29 v v09 = vv[ 9];
30 v v10 = vv[10];
31 v v11 = vv[11];
32 v v12 = vv[12];
33
34 fp();
35
36 vv[ 0] = v00;
37 vv[ 1] = v01;
38 vv[ 2] = v02;
39 vv[ 3] = v03;
40 vv[ 4] = v04;
41 vv[ 5] = v05;
42 vv[ 6] = v06;
43 vv[ 7] = v07;
44 vv[ 8] = v08;
45 vv[ 9] = v09;
46 vv[10] = v10;
47 vv[11] = v11;
48 vv[12] = v12;
49
50 throw 3;
51 }
52
53 v v2;
54
55 int main(void)
56 {
57 v v1 = vt;
58 try {
59 thrower();
60 } catch (int x) {
61 }
62 v2 = v1;
63 if (memcmp (&v2, (v *)&vt, sizeof (v2)) != 0)
64 abort ();
65 return 0;
66 }