public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: David Faust <david.faust@oracle.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] bpf: testsuite: fix unresolved test in memset-1.c
Date: Fri, 08 Mar 2024 09:11:55 +0100	[thread overview]
Message-ID: <87o7bpywfo.fsf@oracle.com> (raw)
In-Reply-To: <20240307175324.25257-1-david.faust@oracle.com> (David Faust's message of "Thu, 7 Mar 2024 09:53:24 -0800")


Hi David.
OK.  Thanks.

> The test was trying to do too much by both checking for an error, and
> checking the resulting assembly. Of course, due to the error no asm was
> produced, so the scan-asm went unresolved. Split it into two separate
> tests to fix the issue.
>
> Tested on x86_64-linux-gnu host for bpf-unknown-none target.
>
> gcc/testsuite/
>
> 	* gcc.target/bpf/memset-1.c: Move error test case to...
> 	* gcc.target/bpf/memset-2.c: ... here. New test.
> ---
>  gcc/testsuite/gcc.target/bpf/memset-1.c |  8 --------
>  gcc/testsuite/gcc.target/bpf/memset-2.c | 22 ++++++++++++++++++++++
>  2 files changed, 22 insertions(+), 8 deletions(-)
>  create mode 100644 gcc/testsuite/gcc.target/bpf/memset-2.c
>
> diff --git a/gcc/testsuite/gcc.target/bpf/memset-1.c b/gcc/testsuite/gcc.target/bpf/memset-1.c
> index 9e9f8eff028..7c4768c6e73 100644
> --- a/gcc/testsuite/gcc.target/bpf/memset-1.c
> +++ b/gcc/testsuite/gcc.target/bpf/memset-1.c
> @@ -28,12 +28,4 @@ set_large (struct context *ctx)
>    __builtin_memset (dest, 0xfe, 130);
>  }
>  
> -void
> -set_variable (struct context *ctx)
> -{
> -  void *data = (void *)(long)ctx->data;
> -  char *dest = data;
> -  __builtin_memset (dest, 0xbc, ctx->data_meta); /* { dg-error "could not inline call" } */
> -}
> -
>  /* { dg-final { scan-assembler-times "call" 0 } } */
> diff --git a/gcc/testsuite/gcc.target/bpf/memset-2.c b/gcc/testsuite/gcc.target/bpf/memset-2.c
> new file mode 100644
> index 00000000000..0602a1a277c
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/bpf/memset-2.c
> @@ -0,0 +1,22 @@
> +/* Test that we error if memset cannot be expanded inline.  */
> +
> +/* { dg-do compile } */
> +/* { dg-options "-O2" } */
> +
> +struct context {
> + unsigned int data;
> + unsigned int data_end;
> + unsigned int data_meta;
> + unsigned int ingress;
> + unsigned int queue_index;
> + unsigned int egress;
> +};
> +
> +
> +void
> +set_variable (struct context *ctx)
> +{
> +  void *data = (void *)(long)ctx->data;
> +  char *dest = data;
> +  __builtin_memset (dest, 0xbc, ctx->data_meta); /* { dg-error "could not inline call" } */
> +}

      reply	other threads:[~2024-03-08  8:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 17:53 David Faust
2024-03-08  8:11 ` Jose E. Marchesi [this message]

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=87o7bpywfo.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=david.faust@oracle.com \
    --cc=gcc-patches@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).