i386: Fix C99 compatibility issues in the x86-64 AVX ABI test suite

Message ID 875y2c8fca.fsf@oldenburg.str.redhat.com
State Accepted
Headers
Series i386: Fix C99 compatibility issues in the x86-64 AVX ABI test suite |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Florian Weimer Nov. 8, 2023, 2:55 p.m. UTC
  * gcc.target/x86_64/abi/avx/avx-check.h (main): Call
	__builtin_printf instead of printf.
	* gcc.target/x86_64/abi/avx/test_passing_m256.c
	(fun_check_passing_m256_8_values): Add missing void return
	type.
	* gcc.target/x86_64/abi/avx512f/avx512f-check.h (main): Call
	__builtin_printf instead of printf.
	* gcc.target/x86_64/abi/avx512f/test_passing_m512.c
	(fun_check_passing_m512_8_values): Add missing void return
	type.

---
 gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h             | 4 ++--
 gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_m256.c     | 1 +
 gcc/testsuite/gcc.target/x86_64/abi/avx512f/avx512f-check.h     | 6 +++---
 gcc/testsuite/gcc.target/x86_64/abi/avx512f/test_passing_m512.c | 1 +
 4 files changed, 7 insertions(+), 5 deletions(-)


base-commit: d72492cca7a66af166b8dcf58d1166d8b0c59c59
  

Comments

Jakub Jelinek Nov. 8, 2023, 2:58 p.m. UTC | #1
On Wed, Nov 08, 2023 at 03:55:17PM +0100, Florian Weimer wrote:
> 	* gcc.target/x86_64/abi/avx/avx-check.h (main): Call
> 	__builtin_printf instead of printf.
> 	* gcc.target/x86_64/abi/avx/test_passing_m256.c
> 	(fun_check_passing_m256_8_values): Add missing void return
> 	type.
> 	* gcc.target/x86_64/abi/avx512f/avx512f-check.h (main): Call
> 	__builtin_printf instead of printf.
> 	* gcc.target/x86_64/abi/avx512f/test_passing_m512.c
> 	(fun_check_passing_m512_8_values): Add missing void return
> 	type.

LGTM.

	Jakub
  
Florian Weimer Nov. 9, 2023, 9:33 a.m. UTC | #2
* Jakub Jelinek:

> On Wed, Nov 08, 2023 at 03:55:17PM +0100, Florian Weimer wrote:
>> 	* gcc.target/x86_64/abi/avx/avx-check.h (main): Call
>> 	__builtin_printf instead of printf.
>> 	* gcc.target/x86_64/abi/avx/test_passing_m256.c
>> 	(fun_check_passing_m256_8_values): Add missing void return
>> 	type.
>> 	* gcc.target/x86_64/abi/avx512f/avx512f-check.h (main): Call
>> 	__builtin_printf instead of printf.
>> 	* gcc.target/x86_64/abi/avx512f/test_passing_m512.c
>> 	(fun_check_passing_m512_8_values): Add missing void return
>> 	type.
>
> LGTM.

I should have scrolled down further, there are more fixes required along
the same lines.  Still okay?

Thanks,
Florian
  
Jakub Jelinek Nov. 9, 2023, 9:36 a.m. UTC | #3
On Thu, Nov 09, 2023 at 10:33:40AM +0100, Florian Weimer wrote:
> * Jakub Jelinek:
> 
> > On Wed, Nov 08, 2023 at 03:55:17PM +0100, Florian Weimer wrote:
> >> 	* gcc.target/x86_64/abi/avx/avx-check.h (main): Call
> >> 	__builtin_printf instead of printf.
> >> 	* gcc.target/x86_64/abi/avx/test_passing_m256.c
> >> 	(fun_check_passing_m256_8_values): Add missing void return
> >> 	type.
> >> 	* gcc.target/x86_64/abi/avx512f/avx512f-check.h (main): Call
> >> 	__builtin_printf instead of printf.
> >> 	* gcc.target/x86_64/abi/avx512f/test_passing_m512.c
> >> 	(fun_check_passing_m512_8_values): Add missing void return
> >> 	type.
> >
> > LGTM.
> 
> I should have scrolled down further, there are more fixes required along
> the same lines.  Still okay?

Yes.

	Jakub
  

Patch

diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h b/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
index e66a27e9afd..a04d0777637 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
@@ -16,12 +16,12 @@  main ()
     {
       avx_test ();
 #ifdef DEBUG
-      printf ("PASSED\n");
+      __builtin_printf ("PASSED\n");
 #endif
     }
 #ifdef DEBUG
   else
-    printf ("SKIPPED\n");
+    __builtin_printf ("SKIPPED\n");
 #endif
 
   return 0;
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_m256.c b/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_m256.c
index ffc3ec36bf7..f739670431b 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_m256.c
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_m256.c
@@ -24,6 +24,7 @@  int failed = 0;
   assert (memcmp (&X1, &X2, sizeof (T)) == 0); \
 } while (0)
 
+void
 fun_check_passing_m256_8_values (__m256 i0 ATTRIBUTE_UNUSED, __m256 i1 ATTRIBUTE_UNUSED, __m256 i2 ATTRIBUTE_UNUSED, __m256 i3 ATTRIBUTE_UNUSED, __m256 i4 ATTRIBUTE_UNUSED, __m256 i5 ATTRIBUTE_UNUSED, __m256 i6 ATTRIBUTE_UNUSED, __m256 i7 ATTRIBUTE_UNUSED)
 {
   /* Check argument values.  */
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx512f/avx512f-check.h b/gcc/testsuite/gcc.target/x86_64/abi/avx512f/avx512f-check.h
index 25ce544c4a3..00a7578d2b5 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx512f/avx512f-check.h
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx512f/avx512f-check.h
@@ -24,17 +24,17 @@  main ()
 	{
 	  avx512f_test ();
 #ifdef DEBUG
-	  printf ("PASSED\n");
+	  __builtin_printf ("PASSED\n");
 #endif
 	}
 #ifdef DEBUG
       else
-	printf ("SKIPPED\n");
+	__builtin_printf ("SKIPPED\n");
 #endif
     }
 #ifdef DEBUG
   else
-    printf ("SKIPPED\n");
+    __builtin_printf ("SKIPPED\n");
 #endif
 
   return 0;
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx512f/test_passing_m512.c b/gcc/testsuite/gcc.target/x86_64/abi/avx512f/test_passing_m512.c
index ead9c6797e1..1c88a55fb4b 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx512f/test_passing_m512.c
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx512f/test_passing_m512.c
@@ -24,6 +24,7 @@  int failed = 0;
   assert (memcmp (&X1, &X2, sizeof (T)) == 0); \
 } while (0)
 
+void
 fun_check_passing_m512_8_values (__m512 i0 ATTRIBUTE_UNUSED, __m512 i1 ATTRIBUTE_UNUSED, __m512 i2 ATTRIBUTE_UNUSED, __m512 i3 ATTRIBUTE_UNUSED, __m512 i4 ATTRIBUTE_UNUSED, __m512 i5 ATTRIBUTE_UNUSED, __m512 i6 ATTRIBUTE_UNUSED, __m512 i7 ATTRIBUTE_UNUSED)
 {
   /* Check argument values.  */