[v1] LoongArch: Run overflow testcases only on LoongArch target

Message ID 20240227071720.1231935-1-mengqinggang@loongson.cn
State New
Headers
Series [v1] LoongArch: Run overflow testcases only on LoongArch target |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_check--master-arm warning Patch is already merged

Commit Message

mengqinggang Feb. 27, 2024, 7:17 a.m. UTC
  ---
 .../ld-loongarch-elf/ld-loongarch-elf.exp     | 27 ++++++++++---------
 1 file changed, 14 insertions(+), 13 deletions(-)
  

Comments

Fangrui Song Feb. 27, 2024, 6:40 p.m. UTC | #1
On Mon, Feb 26, 2024 at 11:17 PM mengqinggang <mengqinggang@loongson.cn> wrote:
>
> ---
>  .../ld-loongarch-elf/ld-loongarch-elf.exp     | 27 ++++++++++---------
>  1 file changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
> index 3a8629a07df..27310fe1275 100644
> --- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
> +++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
> @@ -133,18 +133,19 @@ if [istarget "loongarch64-*-*"] {
>      run_dump_test "desc-norelax"
>      run_dump_test "desc-relax"
>    }
> +
> +  run_dump_test "max_imm_b16"
> +  run_dump_test "max_imm_b21"
> +  run_dump_test "max_imm_b26"
> +  run_dump_test "max_imm_pcrel20"
> +  run_dump_test "overflow_b16"
> +  run_dump_test "overflow_b21"
> +  run_dump_test "overflow_b26"
> +  run_dump_test "overflow_pcrel20"
> +  run_dump_test "underflow_b16"
> +  run_dump_test "underflow_b21"
> +  run_dump_test "underflow_b26"
> +  run_dump_test "underflow_pcrel20"
> +  run_dump_test "pie_discard"
>  }
>
> -run_dump_test "max_imm_b16"
> -run_dump_test "max_imm_b21"
> -run_dump_test "max_imm_b26"
> -run_dump_test "max_imm_pcrel20"
> -run_dump_test "overflow_b16"
> -run_dump_test "overflow_b21"
> -run_dump_test "overflow_b26"
> -run_dump_test "overflow_pcrel20"
> -run_dump_test "underflow_b16"
> -run_dump_test "underflow_b21"
> -run_dump_test "underflow_b26"
> -run_dump_test "underflow_pcrel20"
> -run_dump_test "pie_discard"
> --
> 2.36.0
>

Combining these tests in one file would be much nicer (e.g.
https://github.com/MaskRay/llvm-project/blob/main/lld/test/ELF/systemz-reloc-disp12.s)
I wish that someone  will implement
https://sourceware.org/bugzilla/show_bug.cgi?id=28602
("binutils/testsuite/lib/binutils-common.exp: Support free-form shell
commands and check patterns")

It takes some effort to implement this new framework and integrate it
into DejaGnu, but the long term benefit will be huge.
  
mengqinggang Feb. 29, 2024, 1:23 a.m. UTC | #2
Thanks, I will have a try.


在 2024/2/28 上午2:40, Fangrui Song 写道:
> On Mon, Feb 26, 2024 at 11:17 PM mengqinggang <mengqinggang@loongson.cn> wrote:
>> ---
>>   .../ld-loongarch-elf/ld-loongarch-elf.exp     | 27 ++++++++++---------
>>   1 file changed, 14 insertions(+), 13 deletions(-)
>>
>> diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
>> index 3a8629a07df..27310fe1275 100644
>> --- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
>> +++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
>> @@ -133,18 +133,19 @@ if [istarget "loongarch64-*-*"] {
>>       run_dump_test "desc-norelax"
>>       run_dump_test "desc-relax"
>>     }
>> +
>> +  run_dump_test "max_imm_b16"
>> +  run_dump_test "max_imm_b21"
>> +  run_dump_test "max_imm_b26"
>> +  run_dump_test "max_imm_pcrel20"
>> +  run_dump_test "overflow_b16"
>> +  run_dump_test "overflow_b21"
>> +  run_dump_test "overflow_b26"
>> +  run_dump_test "overflow_pcrel20"
>> +  run_dump_test "underflow_b16"
>> +  run_dump_test "underflow_b21"
>> +  run_dump_test "underflow_b26"
>> +  run_dump_test "underflow_pcrel20"
>> +  run_dump_test "pie_discard"
>>   }
>>
>> -run_dump_test "max_imm_b16"
>> -run_dump_test "max_imm_b21"
>> -run_dump_test "max_imm_b26"
>> -run_dump_test "max_imm_pcrel20"
>> -run_dump_test "overflow_b16"
>> -run_dump_test "overflow_b21"
>> -run_dump_test "overflow_b26"
>> -run_dump_test "overflow_pcrel20"
>> -run_dump_test "underflow_b16"
>> -run_dump_test "underflow_b21"
>> -run_dump_test "underflow_b26"
>> -run_dump_test "underflow_pcrel20"
>> -run_dump_test "pie_discard"
>> --
>> 2.36.0
>>
> Combining these tests in one file would be much nicer (e.g.
> https://github.com/MaskRay/llvm-project/blob/main/lld/test/ELF/systemz-reloc-disp12.s)
> I wish that someone  will implement
> https://sourceware.org/bugzilla/show_bug.cgi?id=28602
> ("binutils/testsuite/lib/binutils-common.exp: Support free-form shell
> commands and check patterns")
>
> It takes some effort to implement this new framework and integrate it
> into DejaGnu, but the long term benefit will be huge.
  

Patch

diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
index 3a8629a07df..27310fe1275 100644
--- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
+++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
@@ -133,18 +133,19 @@  if [istarget "loongarch64-*-*"] {
     run_dump_test "desc-norelax"
     run_dump_test "desc-relax"
   }
+
+  run_dump_test "max_imm_b16"
+  run_dump_test "max_imm_b21"
+  run_dump_test "max_imm_b26"
+  run_dump_test "max_imm_pcrel20"
+  run_dump_test "overflow_b16"
+  run_dump_test "overflow_b21"
+  run_dump_test "overflow_b26"
+  run_dump_test "overflow_pcrel20"
+  run_dump_test "underflow_b16"
+  run_dump_test "underflow_b21"
+  run_dump_test "underflow_b26"
+  run_dump_test "underflow_pcrel20"
+  run_dump_test "pie_discard"
 }
 
-run_dump_test "max_imm_b16"
-run_dump_test "max_imm_b21"
-run_dump_test "max_imm_b26"
-run_dump_test "max_imm_pcrel20"
-run_dump_test "overflow_b16"
-run_dump_test "overflow_b21"
-run_dump_test "overflow_b26"
-run_dump_test "overflow_pcrel20"
-run_dump_test "underflow_b16"
-run_dump_test "underflow_b21"
-run_dump_test "underflow_b26"
-run_dump_test "underflow_pcrel20"
-run_dump_test "pie_discard"