summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/eh/simd-3.C
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/eh/simd-3.C
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.dg/eh/simd-3.C')
-rw-r--r--gcc/testsuite/g++.dg/eh/simd-3.C65
1 files changed, 65 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/eh/simd-3.C b/gcc/testsuite/g++.dg/eh/simd-3.C
new file mode 100644
index 000000000..5ac75c932
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/simd-3.C
@@ -0,0 +1,65 @@
+// { dg-options "-O" }
+// { dg-options "-O -maltivec" { target { powerpc*-*-darwin* && powerpc_altivec_ok } } }
+// { dg-do run }
+
+#include <cstdlib>
+#include <cstring>
+
+typedef int __attribute__((vector_size(16))) v;
+
+v vv[32];
+volatile v vt = { 1, 2, 3, 4 };
+
+void clobber_vrs(void) { };
+
+void (*volatile fp)() = clobber_vrs;
+
+void thrower(void)
+{
+ v v00 = vv[ 0];
+ v v01 = vv[ 1];
+ v v02 = vv[ 2];
+ v v03 = vv[ 3];
+ v v04 = vv[ 4];
+ v v05 = vv[ 5];
+ v v06 = vv[ 6];
+ v v07 = vv[ 7];
+ v v08 = vv[ 8];
+ v v09 = vv[ 9];
+ v v10 = vv[10];
+ v v11 = vv[11];
+ v v12 = vv[12];
+
+ fp();
+
+ vv[ 0] = v00;
+ vv[ 1] = v01;
+ vv[ 2] = v02;
+ vv[ 3] = v03;
+ vv[ 4] = v04;
+ vv[ 5] = v05;
+ vv[ 6] = v06;
+ vv[ 7] = v07;
+ vv[ 8] = v08;
+ vv[ 9] = v09;
+ vv[10] = v10;
+ vv[11] = v11;
+ vv[12] = v12;
+
+ throw 3;
+}
+
+v v2;
+
+int main(void)
+{
+ v v1 = vt;
+ try {
+ thrower();
+ } catch (int x) {
+ }
+ v2 = v1;
+ if (memcmp (&v2, (v *)&vt, sizeof (v2)) != 0)
+ abort ();
+ return 0;
+}