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

Fangrui Song i@maskray.me
Tue Feb 27 18:40:00 GMT 2024


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.


More information about the Binutils mailing list