public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Hongyu Wang <hongyuw@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7443] i386: Fix pr104551 testcase for solaris
Date: Wed,  2 Mar 2022 01:27:31 +0000 (GMT)	[thread overview]
Message-ID: <20220302012731.C4F963858406@sourceware.org> (raw)

https://gcc.gnu.org/g:2f1fa70db51f5356e308e757210d0e521a32e1b7

commit r12-7443-g2f1fa70db51f5356e308e757210d0e521a32e1b7
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Tue Mar 1 19:59:03 2022 +0800

    i386: Fix pr104551 testcase for solaris
    
    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.

Diff:
---
 gcc/testsuite/gcc.target/i386/pr104551.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/pr104551.c b/gcc/testsuite/gcc.target/i386/pr104551.c
index 6300f25c0d5..b839d5b2b0d 100644
--- a/gcc/testsuite/gcc.target/i386/pr104551.c
+++ b/gcc/testsuite/gcc.target/i386/pr104551.c
@@ -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;
 }


                 reply	other threads:[~2022-03-02  1:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220302012731.C4F963858406@sourceware.org \
    --to=hongyuw@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).