https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60732

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Therefore, I concur that the correct action is to have two tests - one for 
> each
> ABI and run both tests on all targets.

Is the following patch what you have in mind (tested on powerpc-apple-darwin9)?

--- ../_gcc_clean/gcc/testsuite/g++.dg/ext/altivec-7.C    2013-10-13
00:58:24.000000000 +0200
+++ gcc/testsuite/g++.dg/ext/altivec-7.C    2014-06-01 17:56:01.000000000 +0200
@@ -2,6 +2,7 @@
 /* { dg-do compile { target powerpc*-*-* } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
+/* { dg-additional-options "-fabi-version=4" { target powerpc*-*-darwin* } }
*/

 #include <altivec.h>

gcc/testsuite/g++.dg/ext/altivec-7a.C
--- ../_gcc_clean/gcc/testsuite/g++.dg/ext/altivec-7a.C    1970-01-01
01:00:00.000000000 +0100
+++ gcc/testsuite/g++.dg/ext/altivec-7a.C    2014-06-01 17:56:22.000000000
+0200
@@ -0,0 +1,37 @@
+/* Test for AltiVec type overloading and name mangling.  */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec" } */
+/* { dg-additional-options "-fabi-version=2" { target powerpc*-*-darwin* } }
*/
+
+#include <altivec.h>
+
+void foo(vector unsigned char) { }
+void foo(vector signed char) { }
+void foo(vector bool     char) { }
+void foo(vector unsigned short) { }
+void foo(vector signed short) { }
+void foo(vector bool short) { }
+void foo(vector unsigned int) { }
+void foo(vector signed int) { }
+void foo(vector bool int) { }
+void foo(vector float) { }
+void foo(vector pixel) { }
+void foo(int) { }
+void foo(unsigned int) { }
+void foo(float) { }
+
+/* { dg-final { scan-assembler "_Z3fooU8__vectorh" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectora" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectorU6__boolc" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectort" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectors" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectorU6__bools" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectorj" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectori" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectorU6__booli" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectorf" } } */
+/* { dg-final { scan-assembler "_Z3fooU8__vectoru7__pixel" } } */
+/* { dg-final { scan-assembler "_Z3fooi" } } */
+/* { dg-final { scan-assembler "_Z3fooj" } } */
+/* { dg-final { scan-assembler "_Z3foof" } } */

Reply via email to