summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/eh/arm-iwmmxt-unwind.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/arm-iwmmxt-unwind.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/arm-iwmmxt-unwind.C')
-rw-r--r--gcc/testsuite/g++.dg/eh/arm-iwmmxt-unwind.C47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/eh/arm-iwmmxt-unwind.C b/gcc/testsuite/g++.dg/eh/arm-iwmmxt-unwind.C
new file mode 100644
index 000000000..109837cd8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/arm-iwmmxt-unwind.C
@@ -0,0 +1,47 @@
+/* Test unwinding of iWMMXt register saves. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm32 } */
+
+#ifdef __IWMMXT__
+extern "C" void abort (void);
+extern "C" void exit (int);
+
+void
+foo (void)
+{
+ register long long wr10 asm("wr10") = 0;
+ register long long wr11 asm("wr11") = 1;
+ register long long wr12 asm("wr12") = 2;
+ register long long wr14 asm("wr14") = 4;
+ register long long wr15 asm("wr15") = 5;
+ asm volatile ("" : "+y" (wr10), "+y" (wr11), "+y" (wr12), "+y" (wr14), "+y" (wr15));
+ throw "";
+}
+
+int
+main (void)
+{
+ register long long wr10 asm("wr10") = 10;
+ register long long wr11 asm("wr11") = 11;
+ register long long wr12 asm("wr12") = 12;
+ register long long wr13 asm("wr13") = 13;
+ register long long wr14 asm("wr14") = 14;
+ register long long wr15 asm("wr15") = 15;
+ asm volatile ("" : "+y" (wr10), "+y" (wr11), "+y" (wr12), "+y" (wr13), "+y" (wr14), "+y" (wr15));
+ try {
+ foo ();
+ } catch (...) {
+ asm volatile ("" : "+y" (wr10), "+y" (wr11), "+y" (wr12), "+y" (wr13), "+y" (wr14), "+y" (wr15));
+ if (wr10 != 10 || wr11 != 11 || wr12 != 12 || wr13 != 13 || wr14 != 14 || wr15 != 15)
+ abort ();
+ }
+ exit (0);
+}
+#else
+int
+main (void)
+{
+}
+#endif