forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: Add norelax function attribute
This patch adds norelax function attribute that be discussed in riscv-c-api-doc PR#94. URL:riscv-non-isa/riscv-c-api-doc#94 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_declare_function_name): Add new attribute.
- Loading branch information
1 parent
705a210
commit 4bee525
Showing
2 changed files
with
49 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32gc" { target { rv32 } } } */ | ||
/* { dg-options "-march=rv64gc" { target { rv64 } } } */ | ||
|
||
__attribute__((norelax)) | ||
void foo1() | ||
{} | ||
|
||
void foo2(void) | ||
{} | ||
|
||
int main() | ||
{ | ||
foo1(); | ||
foo2(); | ||
return 0; | ||
} | ||
|
||
/* { dg-final { scan-assembler-times ".option push\t" 1 } } */ | ||
/* { dg-final { scan-assembler-times ".option norelax\t" 1 } } */ | ||
/* { dg-final { scan-assembler-times ".option pop\t" 1 } } */ |