testsuite: RISC-V: Add '.option norvc' to ensure consistent results.
Commit Message
Add `.option norvc` to several RISC-V tests to avoid compressed
instruction generation. This ensures consistent disassembly and
alignment behavior regardless of assembler default options.
Discussion see:
https://patchwork.sourceware.org/project/binutils/patch/20250910120916.1103023-1-jiawei@iscas.ac.cn/
gas/ChangeLog:
* testsuite/gas/riscv/dis-partial-insn.s: Limit compressed.
* testsuite/gas/riscv/no-relax-align.s: Ditto.
* testsuite/gas/riscv/odd-padding.s: Ditto.
* testsuite/gas/riscv/t_insns.s: Ditto.
* testsuite/gas/riscv/tlsdesc.s: Ditto.
---
gas/testsuite/gas/riscv/dis-partial-insn.s | 1 +
gas/testsuite/gas/riscv/no-relax-align.s | 1 +
gas/testsuite/gas/riscv/odd-padding.s | 1 +
gas/testsuite/gas/riscv/t_insns.s | 1 +
gas/testsuite/gas/riscv/tlsdesc.s | 1 +
5 files changed, 5 insertions(+)
Comments
Thanks for the help. committed :-)
Nelson
On Thu, Sep 11, 2025 at 11:17 AM Jiawei <jiawei@iscas.ac.cn> wrote:
> Add `.option norvc` to several RISC-V tests to avoid compressed
> instruction generation. This ensures consistent disassembly and
> alignment behavior regardless of assembler default options.
>
> Discussion see:
>
> https://patchwork.sourceware.org/project/binutils/patch/20250910120916.1103023-1-jiawei@iscas.ac.cn/
>
> gas/ChangeLog:
>
> * testsuite/gas/riscv/dis-partial-insn.s: Limit compressed.
> * testsuite/gas/riscv/no-relax-align.s: Ditto.
> * testsuite/gas/riscv/odd-padding.s: Ditto.
> * testsuite/gas/riscv/t_insns.s: Ditto.
> * testsuite/gas/riscv/tlsdesc.s: Ditto.
>
> ---
> gas/testsuite/gas/riscv/dis-partial-insn.s | 1 +
> gas/testsuite/gas/riscv/no-relax-align.s | 1 +
> gas/testsuite/gas/riscv/odd-padding.s | 1 +
> gas/testsuite/gas/riscv/t_insns.s | 1 +
> gas/testsuite/gas/riscv/tlsdesc.s | 1 +
> 5 files changed, 5 insertions(+)
>
> diff --git a/gas/testsuite/gas/riscv/dis-partial-insn.s
> b/gas/testsuite/gas/riscv/dis-partial-insn.s
> index 99456883315..77453af59aa 100644
> --- a/gas/testsuite/gas/riscv/dis-partial-insn.s
> +++ b/gas/testsuite/gas/riscv/dis-partial-insn.s
> @@ -1,2 +1,3 @@
> target:
> + .option norvc
> nop
> diff --git a/gas/testsuite/gas/riscv/no-relax-align.s
> b/gas/testsuite/gas/riscv/no-relax-align.s
> index 23b43e0a4ce..a625d643b1f 100644
> --- a/gas/testsuite/gas/riscv/no-relax-align.s
> +++ b/gas/testsuite/gas/riscv/no-relax-align.s
> @@ -1,4 +1,5 @@
> .option norelax
> + .option norvc
> .align 4
> nop
> nop
> diff --git a/gas/testsuite/gas/riscv/odd-padding.s
> b/gas/testsuite/gas/riscv/odd-padding.s
> index 9e434eae261..44b7a544897 100644
> --- a/gas/testsuite/gas/riscv/odd-padding.s
> +++ b/gas/testsuite/gas/riscv/odd-padding.s
> @@ -1,3 +1,4 @@
> + .option norvc
> .text
> byte:
> nop
> diff --git a/gas/testsuite/gas/riscv/t_insns.s
> b/gas/testsuite/gas/riscv/t_insns.s
> index 99456883315..77453af59aa 100644
> --- a/gas/testsuite/gas/riscv/t_insns.s
> +++ b/gas/testsuite/gas/riscv/t_insns.s
> @@ -1,2 +1,3 @@
> target:
> + .option norvc
> nop
> diff --git a/gas/testsuite/gas/riscv/tlsdesc.s
> b/gas/testsuite/gas/riscv/tlsdesc.s
> index 15468d5f947..2d0aec0e5cb 100644
> --- a/gas/testsuite/gas/riscv/tlsdesc.s
> +++ b/gas/testsuite/gas/riscv/tlsdesc.s
> @@ -1,3 +1,4 @@
> + .option norvc
> .section .tbss,"awT",@nobits
> .global sg1
> sg1:
> --
> 2.43.0
>
>
@@ -1,2 +1,3 @@
target:
+ .option norvc
nop
@@ -1,4 +1,5 @@
.option norelax
+ .option norvc
.align 4
nop
nop
@@ -1,3 +1,4 @@
+ .option norvc
.text
byte:
nop
@@ -1,2 +1,3 @@
target:
+ .option norvc
nop
@@ -1,3 +1,4 @@
+ .option norvc
.section .tbss,"awT",@nobits
.global sg1
sg1: