This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch: simd C++ exception handling tests
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 1 Apr 2003 15:17:25 -0400
- Subject: Re: patch: simd C++ exception handling tests
On Tuesday, April 1, 2003, at 10:42 AM, Jason Merrill wrote:
On Tue, 1 Apr 2003 10:25:45 -0400, Aldy Hernandez <aldyh at redhat dot com>
wrote:
(and yes, I stole the tests for some other EH test ;-))
I'd probably remove the "step" stuff from these tests. Otherwise OK.
Okey. Thanks. Final patch below. Applied.
2003-04-01 Aldy Hernandez <aldyh at redhat dot com>
* testsuite/g++.dg/eh/simd-1.C: New.
* testsuite/g++.dg/eh/simd-2.C: New.
Index: testsuite/g++.dg/eh/simd-1.C
===================================================================
RCS file: testsuite/g++.dg/eh/simd-1.C
diff -N testsuite/g++.dg/eh/simd-1.C
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/eh/simd-1.C 1 Apr 2003 19:15:35 -0000
***************
*** 0 ****
--- 1,49 ----
+ // Test EH when V2SI SIMD registers are involved.
+ // Contributed by Aldy Hernandez (aldy at quesejoda dot com).
+ // { dg-options "-O" }
+ // { dg-do run }
+
+ typedef int __attribute__((mode(V2SI))) vecint;
+
+ vecint vecfunc (vecint beachbum)
+ {
+ return vecint;
+ }
+
+ void f3 (void)
+ {
+ /* Force a use of a V2SI register if available. On the PPC/E500,
+ this will cause the compiler to save the registers in this
+ function in 64-bits. */
+ vecint foobar = (vecint) {0, 0};
+ foobar = vecfunc (foobar);
+
+ throw int();
+ }
+
+ void f2 (void)
+ {
+ vecint foobar = (vecint) {0, 0};
+ foobar = vecfunc (foobar);
+
+ f3 ();
+ }
+
+ void f1 (void)
+ {
+ int i;
+ try
+ {
+ f2 ();
+ }
+ catch (int)
+ {
+ i = 9;
+ }
+ }
+
+ int main ()
+ {
+ f1 ();
+ return 0;
+ }
Index: testsuite/g++.dg/eh/simd-2.C
===================================================================
RCS file: testsuite/g++.dg/eh/simd-2.C
diff -N testsuite/g++.dg/eh/simd-2.C
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/eh/simd-2.C 1 Apr 2003 19:15:35 -0000
***************
*** 0 ****
--- 1,46 ----
+ // Test EH when V4SI SIMD registers are involved.
+ // Contributed by Aldy Hernandez (aldy at quesejoda dot com).
+ // { dg-options "-O" }
+ // { dg-do run }
+
+ typedef int __attribute__((mode(V4SI))) vecint;
+
+ vecint vecfunc (vecint beachbum)
+ {
+ return vecint;
+ }
+
+ void f3 (void)
+ {
+ vecint foobar = (vecint) {0, 0};
+ foobar = vecfunc (foobar);
+
+ throw int();
+ }
+
+ void f2 (void)
+ {
+ vecint foobar = (vecint) {0, 0};
+ foobar = vecfunc (foobar);
+
+ f3 ();
+ }
+
+ void f1 (void)
+ {
+ int i;
+ try
+ {
+ f2 ();
+ }
+ catch (int)
+ {
+ i = 9;
+ }
+ }
+
+ int main ()
+ {
+ f1 ();
+ return 0;
+ }