]> gcc.gnu.org Git - gcc.git/commitdiff
i386: Fix pr104551 testcase for solaris
authorHongyu Wang <hongyu.wang@intel.com>
Tue, 1 Mar 2022 11:59:03 +0000 (19:59 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Wed, 2 Mar 2022 01:25:58 +0000 (09:25 +0800)
Use avx2-check mechanism to avoid illegal instrucion on non-avx2 target.

gcc/testsuite/ChangeLog:

PR target/104726
* gcc.target/i386/pr104551.c: Use avx2-check.h.

gcc/testsuite/gcc.target/i386/pr104551.c

index 6300f25c0d500021d4427876465216c5af7cf482..b839d5b2b0d052de785cae45328125f98dd00337 100644 (file)
@@ -2,6 +2,8 @@
 /* { dg-options "-O3 -mavx2" } */
 /* { dg-require-effective-target avx2 } */
 
+#include "avx2-check.h"
+
 unsigned int
 __attribute__((noipa))
 test(unsigned int a, unsigned char p[16]) {
@@ -11,7 +13,8 @@ test(unsigned int a, unsigned char p[16]) {
   return res;
 }
 
-int main ()
+static void
+avx2_test (void)
 {
   unsigned int a = 16U;
   unsigned char p[16];
@@ -20,5 +23,4 @@ int main ()
   unsigned int res = test (a, p);
   if (res != 128)
     __builtin_abort ();
-  return 0;
 }
This page took 0.085892 seconds and 5 git commands to generate.