]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Add tests for constraints "i" and "s"
authorFangrui Song <maskray@gcc.gnu.org>
Wed, 31 Jan 2024 04:41:12 +0000 (20:41 -0800)
committerFangrui Song <maskray@gcc.gnu.org>
Thu, 22 Feb 2024 01:20:33 +0000 (17:20 -0800)
commit9ca4c1bf082a4691482ca9f4814fea68f04e2cb3
treef8d9d16e3e47513753249df4886d8af318d85841
parent98004ca00e4bf7a513cf3de65d3c3d9ad373872e
RISC-V: Add tests for constraints "i" and "s"

The constraints "i" and "s" can be used with a symbol that binds
externally, e.g.
```
namespace ns { extern int var, a[4]; }
void foo() {
  asm(".pushsection .xxx,\"aw\"; .dc.a %0; .popsection" :: "s"(&ns::var));
  asm(".reloc ., BFD_RELOC_NONE, %0" :: "s"(&ns::a[3]));
}
```

gcc/testsuite/ChangeLog:

* gcc.target/riscv/asm-raw-symbol.c: New test.
gcc/testsuite/gcc.target/riscv/asm-raw-symbol.c [new file with mode: 0644]