2018-01-11 21:36:56 +08:00
|
|
|
// RUN: %clang -target riscv32-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s
|
|
|
|
// RUN: %clang -target riscv64-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s
|
|
|
|
|
|
|
|
// CHECK: fno-signed-char
|
2018-05-29 08:44:15 +08:00
|
|
|
|
[RISC-V] Add -msave-restore and -mno-save-restore to clang driver
Summary:
The GCC RISC-V toolchain accepts `-msave-restore` and `-mno-save-restore`
to control whether libcalls are used for saving and restoring the stack within
prologues and epilogues.
Clang currently errors if someone passes -msave-restore or -mno-save-restore.
This means that people need to change build configurations to use clang. This
patch adds these flags, so that clang invocations can now match gcc.
As the RISC-V backend does not currently have a `save-restore` target feature,
we emit a warning if someone requests `-msave-restore`. LLVM does not error if
we pass the (unimplemented) target features `+save-restore` or `-save-restore`.
Reviewers: asb, luismarques
Reviewed By: asb
Subscribers: rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63498
llvm-svn: 364018
2019-06-21 18:03:31 +08:00
|
|
|
// RUN: %clang -target riscv32-unknown-elf -### %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
|
|
|
|
|
2018-05-29 08:44:15 +08:00
|
|
|
// RUN: %clang -target riscv32-unknown-elf -### %s -mrelax 2>&1 | FileCheck %s -check-prefix=RELAX
|
|
|
|
// RUN: %clang -target riscv32-unknown-elf -### %s -mno-relax 2>&1 | FileCheck %s -check-prefix=NO-RELAX
|
|
|
|
|
|
|
|
// RELAX: "-target-feature" "+relax"
|
|
|
|
// NO-RELAX: "-target-feature" "-relax"
|
2019-02-18 00:05:51 +08:00
|
|
|
// DEFAULT: "-target-feature" "+relax"
|
2018-05-29 08:44:15 +08:00
|
|
|
// DEFAULT-NOT: "-target-feature" "-relax"
|
[RISC-V] Add -msave-restore and -mno-save-restore to clang driver
Summary:
The GCC RISC-V toolchain accepts `-msave-restore` and `-mno-save-restore`
to control whether libcalls are used for saving and restoring the stack within
prologues and epilogues.
Clang currently errors if someone passes -msave-restore or -mno-save-restore.
This means that people need to change build configurations to use clang. This
patch adds these flags, so that clang invocations can now match gcc.
As the RISC-V backend does not currently have a `save-restore` target feature,
we emit a warning if someone requests `-msave-restore`. LLVM does not error if
we pass the (unimplemented) target features `+save-restore` or `-save-restore`.
Reviewers: asb, luismarques
Reviewed By: asb
Subscribers: rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63498
llvm-svn: 364018
2019-06-21 18:03:31 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target riscv32-unknown-elf -### %s -msave-restore 2>&1 | FileCheck %s -check-prefix=SAVE-RESTORE
|
|
|
|
// RUN: %clang -target riscv32-unknown-elf -### %s -mno-save-restore 2>&1 | FileCheck %s -check-prefix=NO-SAVE-RESTORE
|
|
|
|
|
2020-02-12 05:23:03 +08:00
|
|
|
// SAVE-RESTORE: "-target-feature" "+save-restore"
|
|
|
|
// NO-SAVE-RESTORE: "-target-feature" "-save-restore"
|
|
|
|
// DEFAULT: "-target-feature" "-save-restore"
|
|
|
|
// DEFAULT-NOT: "-target-feature" "+save-restore"
|
2019-09-10 16:16:24 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target riscv32-linux -### %s -fsyntax-only 2>&1 \
|
|
|
|
// RUN: | FileCheck %s -check-prefix=DEFAULT-LINUX
|
|
|
|
// RUN: %clang -target riscv64-linux -### %s -fsyntax-only 2>&1 \
|
|
|
|
// RUN: | FileCheck %s -check-prefix=DEFAULT-LINUX
|
|
|
|
|
|
|
|
// DEFAULT-LINUX: "-target-feature" "+m"
|
|
|
|
// DEFAULT-LINUX-SAME: "-target-feature" "+a"
|
|
|
|
// DEFAULT-LINUX-SAME: "-target-feature" "+f"
|
|
|
|
// DEFAULT-LINUX-SAME: "-target-feature" "+d"
|
|
|
|
// DEFAULT-LINUX-SAME: "-target-feature" "+c"
|