]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.arch/altivec-regs.c
[gdb/testsuite] Fix timeout in gdb.tui/resize-2.exp
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / altivec-regs.c
index 4d4fe3f5dbb783ead5665c613757ba1ca3a824be..a838b28b9b51f8905eff14f01a3c3d8500a981c0 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdio.h>
 
 vector unsigned int
-vector_fun (vector unsigned int a, vector unsigned int b)
+vector_fun (volatile vector unsigned int a, volatile vector unsigned int b)
 {
   vector unsigned int c;
   a = ((vector unsigned int) vec_splat_u8(2));
@@ -18,14 +18,20 @@ main ()
   vector unsigned int y; 
   vector unsigned int x; 
   vector unsigned int z; 
-  int a;
+  int a = 0;
+
+  #ifdef _AIX
+  /* On AIX, the debugger cannot access vector registers before they
+     are first used by the inferior.  Perform such an access here.  */
+  x = ((vector unsigned int) vec_splat_u8 (0));
+  #endif
 
   /* This line may look unnecessary but we do need it, because we want to
      have a line to do a next over (so that gdb refetches the registers)
      and we don't want the code to change any vector registers.
      The splat operations below modify the VRs,i
      so we don't want to execute them yet.  */
-  a = 9;
+  a = 9; /* start here */
   x = ((vector unsigned int) vec_splat_u8 (-2));
   y = ((vector unsigned int) vec_splat_u8 (1));