public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Lulu Cheng <chenglulu@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] LoongArch: testsuite: refine __tls_get_addr tests with tls_native
Date: Mon, 29 Aug 2022 11:35:48 +0800	[thread overview]
Message-ID: <d6baa2f8-6a9f-0976-917d-8327c28b4ac2@loongson.cn> (raw)
In-Reply-To: <37c4ff2310c2ea983aa2d1215b381af312ad1fed.camel@xry111.site>

LGTM!

Thanks.

在 2022/8/24 下午10:09, Xi Ruoyao 写道:
> If GCC is not built with a working linker for the target (developers
> occansionally build such a "minimal" GCC for testing and debugging),
> TLS will be emulated and __tls_get_addr won't be used.  Refine those
> tests depending on __tls_get_addr with tls_native to avoid test
> failures.
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.target/loongarch/func-call-medium-1.c: Refine test
> 	depending on __tls_get_addr with { target tls_native }.
> 	* gcc.target/loongarch/func-call-medium-2.c: Likewise.
> 	* gcc.target/loongarch/func-call-medium-3.c: Likewise.
> 	* gcc.target/loongarch/func-call-medium-4.c: Likewise.
> 	* gcc.target/loongarch/func-call-medium-5.c: Likewise.
> 	* gcc.target/loongarch/func-call-medium-6.c: Likewise.
> 	* gcc.target/loongarch/func-call-medium-7.c: Likewise.
> 	* gcc.target/loongarch/func-call-medium-8.c: Likewise.
> 	* gcc.target/loongarch/tls-gd-noplt.c: Likewise.
> ---
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-1.c | 2 +-
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-2.c | 2 +-
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-3.c | 2 +-
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-4.c | 2 +-
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-5.c | 2 +-
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-6.c | 2 +-
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-7.c | 2 +-
>   gcc/testsuite/gcc.target/loongarch/func-call-medium-8.c | 3 ++-
>   gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c       | 2 +-
>   9 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-1.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-1.c
> index 276d73e5ee8..6339e832fe5 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-1.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-1.c
> @@ -3,7 +3,7 @@
>   /* { dg-final { scan-assembler "test:.*la\.global\t.*g\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test1:.*la\.global\t.*f\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test2:.*la\.local\t.*l\n\tjirl" } } */
> -/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" } } */
> +/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" { target tls_native } } } */
>   
>   extern void g (void);
>   void
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-2.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-2.c
> index 237821c066b..a53e75e0bf9 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-2.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-2.c
> @@ -3,7 +3,7 @@
>   /* { dg-final { scan-assembler "test:.*la\.global\t.*g\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test1:.*la\.local\t.*f\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test2:.*la\.local\t.*l\n\tjirl" } } */
> -/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" } } */
> +/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" { target tls_native } } } */
>   
>   extern void g (void);
>   void
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-3.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-3.c
> index 9a6e16103bc..0da7bf98e3c 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-3.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-3.c
> @@ -3,7 +3,7 @@
>   /* { dg-final { scan-assembler "test:.*la\.global\t.*g\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test1:.*la\.global\t.*f\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test2:.*la\.local\t.*l\n\tjirl" } } */
> -/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" } } */
> +/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" { target tls_native } } } */
>   
>   extern void g (void);
>   void
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-4.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-4.c
> index 2577e345239..0219688ae80 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-4.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-4.c
> @@ -3,7 +3,7 @@
>   /* { dg-final { scan-assembler "test:.*la\.global\t.*g\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test1:.*la\.local\t.*f\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test2:.*la\.local\t.*l\n\tjirl" } } */
> -/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" } } */
> +/* { dg-final { scan-assembler "test3:.*la\.global\t.*\_\_tls\_get\_addr" { target tls_native } } } */
>   
>   extern void g (void);
>   void
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-5.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-5.c
> index d70b6ea4663..8a47b5afcba 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-5.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-5.c
> @@ -3,7 +3,7 @@
>   /* { dg-final { scan-assembler "test:.*pcalau12i.*%pc_hi20\\(g\\)\n\tjirl.*pc_lo12\\(g\\)" } } */
>   /* { dg-final { scan-assembler "test1:.*pcalau12i.*%pc_hi20\\(f\\)\n\tjirl.*%pc_lo12\\(f\\)" } } */
>   /* { dg-final { scan-assembler "test2:.*pcalau12i.*%pc_hi20\\(l\\)\n\tjirl.*%pc_lo12\\(l\\)" } } */
> -/* { dg-final { scan-assembler "test3:.*pcalau12i.*%pc_hi20\\(__tls_get_addr\\)\n\t.*\n\tjirl.*%pc_lo12\\(__tls_get_addr\\)" } } */
> +/* { dg-final { scan-assembler "test3:.*pcalau12i.*%pc_hi20\\(__tls_get_addr\\)\n\t.*\n\tjirl.*%pc_lo12\\(__tls_get_addr\\)" { target tls_native } } } */
>   
>   extern void g (void);
>   
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-6.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-6.c
> index f963a99441a..1e75e60e01a 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-6.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-6.c
> @@ -3,7 +3,7 @@
>   /* { dg-final { scan-assembler "test:.*pcalau12i.*%pc_hi20\\(g\\)\n\tjirl.*pc_lo12\\(g\\)" } } */
>   /* { dg-final { scan-assembler "test1:.*pcalau12i.*%pc_hi20\\(f\\)\n\tjirl.*%pc_lo12\\(f\\)" } } */
>   /* { dg-final { scan-assembler "test2:.*pcalau12i.*%pc_hi20\\(l\\)\n\tjirl.*%pc_lo12\\(l\\)" } } */
> -/* { dg-final { scan-assembler "test3:.*pcalau12i.*%pc_hi20\\(__tls_get_addr\\)\n\t.*\n\tjirl.*%pc_lo12\\(__tls_get_addr\\)" } } */
> +/* { dg-final { scan-assembler "test3:.*pcalau12i.*%pc_hi20\\(__tls_get_addr\\)\n\t.*\n\tjirl.*%pc_lo12\\(__tls_get_addr\\)" { target tls_native } } } */
>   
>   extern void g (void);
>   
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-7.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-7.c
> index f2818b2da76..9e89085ca19 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-7.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-7.c
> @@ -3,7 +3,7 @@
>   /* { dg-final { scan-assembler "test:.*pcalau12i\t.*%got_pc_hi20\\(g\\)\n\tld\.d\t.*%got_pc_lo12\\(g\\)\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test1:.*pcalau12i\t.*%got_pc_hi20\\(f\\)\n\tld\.d\t.*%got_pc_lo12\\(f\\)\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test2:.*pcalau12i\t.*%pc_hi20\\(l\\)\n\tjirl.*%pc_lo12\\(l\\)" } } */
> -/* { dg-final { scan-assembler "test3:.*pcalau12i.*%got_pc_hi20\\(__tls_get_addr\\)\n\tld\.d.*%got_pc_lo12\\(__tls_get_addr\\)" } } */
> +/* { dg-final { scan-assembler "test3:.*pcalau12i.*%got_pc_hi20\\(__tls_get_addr\\)\n\tld\.d.*%got_pc_lo12\\(__tls_get_addr\\)" { target tls_native } } } */
>   
>   
>   extern void g (void);
> diff --git a/gcc/testsuite/gcc.target/loongarch/func-call-medium-8.c b/gcc/testsuite/gcc.target/loongarch/func-call-medium-8.c
> index 7fa873d84bb..fde9c6e0ef4 100644
> --- a/gcc/testsuite/gcc.target/loongarch/func-call-medium-8.c
> +++ b/gcc/testsuite/gcc.target/loongarch/func-call-medium-8.c
> @@ -3,7 +3,8 @@
>   /* { dg-final { scan-assembler "test:.*pcalau12i\t.*%got_pc_hi20\\(g\\)\n\tld\.d\t.*%got_pc_lo12\\(g\\)\n\tjirl" } } */
>   /* { dg-final { scan-assembler "test1:.*pcalau12i\t.*%pc_hi20\\(f\\)\n\tjirl.*%pc_lo12\\(f\\)" } } */
>   /* { dg-final { scan-assembler "test2:.*pcalau12i\t.*%pc_hi20\\(l\\)\n\tjirl.*%pc_lo12\\(l\\)" } } */
> -/* { dg-final { scan-assembler "test3:.*pcalau12i.*%got_pc_hi20\\(__tls_get_addr\\)\n\tld\.d.*%got_pc_lo12\\(__tls_get_addr\\)" } } */
> +/* { dg-final { scan-assembler "test3:.*pcalau12i.*%got_pc_hi20\\(__tls_get_addr\\)\n\tld\.d.*%got_pc_lo12\\(__tls_get_addr\\)" { target tls_native } } } */
> +/* { dg-final { scan-assembler "test3:.*pcalau12i.*%got_pc_hi20\\(__tls_get_addr\\)\n\tld\.d.*%got_pc_lo12\\(__tls_get_addr\\)" { target tls_native } } } */
>   
>   extern void g (void);
>   
> diff --git a/gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c b/gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c
> index 375663286f0..9432c477e9d 100644
> --- a/gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c
> +++ b/gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c
> @@ -1,6 +1,6 @@
>   /* { dg-do compile } */
>   /* { dg-options "-O0 -fno-plt -mcmodel=normal -mexplicit-relocs" } */
> -/* { dg-final { scan-assembler "pcalau12i\t.*%got_pc_hi20\\(__tls_get_addr\\)\n\tld\.d.*%got_pc_lo12\\(__tls_get_addr\\)" } } */
> +/* { dg-final { scan-assembler "pcalau12i\t.*%got_pc_hi20\\(__tls_get_addr\\)\n\tld\.d.*%got_pc_lo12\\(__tls_get_addr\\)" { target tls_native } } } */
>   
>   __attribute__ ((tls_model ("global-dynamic"))) __thread int a;
>   


      reply	other threads:[~2022-08-29  3:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 14:09 Xi Ruoyao
2022-08-29  3:35 ` Lulu Cheng [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=d6baa2f8-6a9f-0976-917d-8327c28b4ac2@loongson.cn \
    --to=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=xry111@xry111.site \
    /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).