diff options
author | Ana Pazos <apazos@codeaurora.org> | 2018-07-26 17:49:43 +0000 |
---|---|---|
committer | Ana Pazos <apazos@codeaurora.org> | 2018-07-26 17:49:43 +0000 |
commit | 2e4106b73da2bd2845f9676e79ea43d4d3540813 (patch) | |
tree | f3be63cd6ad43d316d4dd9e98ccf501eb402efe5 /llvm/test/CodeGen/RISCV/interrupt-attr-invalid.ll | |
parent | 09810c9269dce1745f81601d364b9aeea286c200 (diff) | |
download | bcm5719-llvm-2e4106b73da2bd2845f9676e79ea43d4d3540813.tar.gz bcm5719-llvm-2e4106b73da2bd2845f9676e79ea43d4d3540813.zip |
[RISCV] Add support for _interrupt attribute
- Save/restore only registers that are used.
This includes Callee saved registers and Caller saved registers
(arguments and temporaries) for integer and FP registers.
- If there is a call in the interrupt handler, save/restore all
Caller saved registers (arguments and temporaries) and all FP registers.
- Emit special return instructions depending on "interrupt"
attribute type.
Based on initial patch by Zhaoshi Zheng.
Reviewers: asb
Reviewed By: asb
Subscribers: rkruppe, the_o, MartinMosbeck, brucehoult, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, rogfer01, llvm-commits
Differential Revision: https://reviews.llvm.org/D48411
llvm-svn: 338047
Diffstat (limited to 'llvm/test/CodeGen/RISCV/interrupt-attr-invalid.ll')
-rw-r--r-- | llvm/test/CodeGen/RISCV/interrupt-attr-invalid.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/RISCV/interrupt-attr-invalid.ll b/llvm/test/CodeGen/RISCV/interrupt-attr-invalid.ll new file mode 100644 index 00000000000..bddca8af746 --- /dev/null +++ b/llvm/test/CodeGen/RISCV/interrupt-attr-invalid.ll @@ -0,0 +1,11 @@ +; RUN: not llc -mtriple riscv32-unknown-elf -o - %s \ +; RUN: 2>&1 | FileCheck %s +; RUN: not llc -mtriple riscv64-unknown-elf -o - %s \ +; RUN: 2>&1 | FileCheck %s + +; CHECK: LLVM ERROR: Function interrupt attribute argument not supported! +define void @isr_user() #0 { + ret void +} + +attributes #0 = { "interrupt"="foo" } |