This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] another obvious altivec testcase fix


On Fri, Aug 13, 2004 at 11:19:02AM -0700, Janis Johnson wrote:
> On Fri, Aug 13, 2004 at 02:11:50PM -0400, Daniel Jacobowitz wrote:
> > On Thu, Aug 12, 2004 at 11:11:04AM -0700, Janis Johnson wrote:
> > > This patch makes an AltiVec execution test check for the existence
> > > of AltiVec hardware before using any AltiVec instructions.  Committed
> > > to mainline as obvious after testing on powerpc64-linux systems with
> > > and without VMX hardware.
> > 
> > You may need to mark main1 as noinline for this to work...
> 
> Ah, that might explain why it works for me sometimes but not others.

This test checks compile-time functionality so I'm reverting the previous
changes and turning it into a compile-only test.

2004-08-13  Janis Johnson  <janis187@us.ibm.com>

	* g++.dg/ext/altivec-2.C: Revert previous changes and don't execute.

--- altivec-2.C.orig	2004-08-13 13:14:47.000000000 -0700
+++ altivec-2.C	2004-08-13 13:13:57.000000000 -0700
@@ -1,4 +1,4 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do compile { target powerpc*-*-* } } */
 /* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "-maltivec" } { "" } } */
 /* { dg-options "-maltivec -Wall" } */
 
@@ -8,13 +8,15 @@
 #include <altivec.h>
 #include "altivec_check.h"
 
-int main1 (void)
+int main (int argc, const char * argv[])
 {
   int i;
   const float cf = 1.0;
   vector float v;
   const vector float cv = (vector float){1.0, 2.0, 3.0, 4.0};
 
+  altivec_check ();
+
   vec_dst(&cv, i, 0);
   v = vec_ld(0, &cv);	
   v = vec_lde(0, &cf);
@@ -22,9 +24,3 @@ int main1 (void)
   
   return 0;
 }
-
-int main (int argc, const char * argv[])
-{
-  altivec_check ();
-  return main1 ();
-}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]