testsuite: btf: Fix btf-datasec-1.c for RISC-V

Message ID 20220504002714.2423-1-palmer@rivosinc.com
State Committed
Commit 010af1040bcf4870c8f1aac88a7b1538f622858b
Headers
Series testsuite: btf: Fix btf-datasec-1.c for RISC-V |

Commit Message

Palmer Dabbelt May 4, 2022, 12:27 a.m. UTC
  Similar to 37e65643d3e ("testsuite/101269: fix testcase when used with
-m32"), RISC-V needs to be told not to put symbols in the
sdata/srodata/sbss sections.

gcc/testsuite/ChangeLog

	* debug/btf/btf-datasec-1.c: Don't use small data on RISC-V.
---
 gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Kito Cheng May 11, 2022, 1:31 a.m. UTC | #1
LGTM, that's only added a new option for RISC-V and won't affect all
other targets, so I assume I can approve that.

On Wed, May 4, 2022 at 8:27 AM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>
> Similar to 37e65643d3e ("testsuite/101269: fix testcase when used with
> -m32"), RISC-V needs to be told not to put symbols in the
> sdata/srodata/sbss sections.
>
> gcc/testsuite/ChangeLog
>
>         * debug/btf/btf-datasec-1.c: Don't use small data on RISC-V.
> ---
>  gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
> index dbb236bbda1..77df88648c5 100644
> --- a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
> +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
> @@ -12,6 +12,7 @@
>  /* { dg-do compile )  */
>  /* { dg-options "-O0 -gbtf -dA" } */
>  /* { dg-options "-O0 -gbtf -dA -msdata=none" { target { { powerpc*-*-* } && ilp32 } } } */
> +/* { dg-options "-O0 -gbtf -dA -msmall-data-limit=0" { target { riscv*-*-* } } } */
>  /* { dg-options "-O0 -gbtf -dA -G0" { target { nios2-*-* } } } */
>
>  /* Check for two DATASEC entries with vlen 3, and one with vlen 1.  */
> --
> 2.34.1
>
  
Palmer Dabbelt May 13, 2022, 4:53 p.m. UTC | #2
On Tue, 10 May 2022 18:31:37 PDT (-0700), Kito Cheng wrote:
> LGTM, that's only added a new option for RISC-V and won't affect all
> other targets, so I assume I can approve that.

I always forget what the rules are, but someone recently reminded me and 
yes that's the case.  I committed this.

Thanks!

>
> On Wed, May 4, 2022 at 8:27 AM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>>
>> Similar to 37e65643d3e ("testsuite/101269: fix testcase when used with
>> -m32"), RISC-V needs to be told not to put symbols in the
>> sdata/srodata/sbss sections.
>>
>> gcc/testsuite/ChangeLog
>>
>>         * debug/btf/btf-datasec-1.c: Don't use small data on RISC-V.
>> ---
>>  gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
>> index dbb236bbda1..77df88648c5 100644
>> --- a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
>> +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
>> @@ -12,6 +12,7 @@
>>  /* { dg-do compile )  */
>>  /* { dg-options "-O0 -gbtf -dA" } */
>>  /* { dg-options "-O0 -gbtf -dA -msdata=none" { target { { powerpc*-*-* } && ilp32 } } } */
>> +/* { dg-options "-O0 -gbtf -dA -msmall-data-limit=0" { target { riscv*-*-* } } } */
>>  /* { dg-options "-O0 -gbtf -dA -G0" { target { nios2-*-* } } } */
>>
>>  /* Check for two DATASEC entries with vlen 3, and one with vlen 1.  */
>> --
>> 2.34.1
>>
  
Mike Stump Sept. 10, 2022, 4:10 a.m. UTC | #3
On May 10, 2022, at 6:31 PM, Kito Cheng via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> LGTM, that's only added a new option for RISC-V and won't affect all
> other targets, so I assume I can approve that.

Yes.  Usual and customary for ports.
  

Patch

diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
index dbb236bbda1..77df88648c5 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
@@ -12,6 +12,7 @@ 
 /* { dg-do compile )  */
 /* { dg-options "-O0 -gbtf -dA" } */
 /* { dg-options "-O0 -gbtf -dA -msdata=none" { target { { powerpc*-*-* } && ilp32 } } } */
+/* { dg-options "-O0 -gbtf -dA -msmall-data-limit=0" { target { riscv*-*-* } } } */
 /* { dg-options "-O0 -gbtf -dA -G0" { target { nios2-*-* } } } */
 
 /* Check for two DATASEC entries with vlen 3, and one with vlen 1.  */