diff options
author | Kito Cheng <kito.cheng@gmail.com> | 2019-09-17 08:09:56 +0000 |
---|---|---|
committer | Kito Cheng <kito.cheng@gmail.com> | 2019-09-17 08:09:56 +0000 |
commit | 4f5495d1369407d0798c577d0c47d5d2ce990d45 (patch) | |
tree | 48dfca4b7a1cf714f678be4c0bc09e8a7e265e5e /test/Preprocessor | |
parent | 8fd910d9ac66af41e21108958988a7b5ffadf737 (diff) | |
download | clang-4f5495d1369407d0798c577d0c47d5d2ce990d45.tar.gz |
[RISCV] Define __riscv_cmodel_medlow and __riscv_cmodel_medany correctly
RISC-V LLVM was only implement small/medlow code model, so it defined
__riscv_cmodel_medlow directly without check.
Now, we have medium/medany code model in RISC-V back-end, it should
define according the actually code model.
Reviewed By: lewis-revill
Differential Revision: https://reviews.llvm.org/D67065
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor')
-rw-r--r-- | test/Preprocessor/riscv-cmodel.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Preprocessor/riscv-cmodel.c b/test/Preprocessor/riscv-cmodel.c new file mode 100644 index 0000000000..b28c27c9cc --- /dev/null +++ b/test/Preprocessor/riscv-cmodel.c @@ -0,0 +1,20 @@ +// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \ +// RUN: -o - | FileCheck --check-prefix=CHECK-MEDLOW %s +// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \ +// RUN: -o - | FileCheck --check-prefix=CHECK-MEDLOW %s + +// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \ +// RUN: -mcmodel=small -o - | FileCheck --check-prefix=CHECK-MEDLOW %s +// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \ +// RUN: -mcmodel=small -o - | FileCheck --check-prefix=CHECK-MEDLOW %s + +// CHECK-MEDLOW: #define __riscv_cmodel_medlow 1 +// CHECK-MEDLOW-NOT: __riscv_cmodel_medany + +// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \ +// RUN: -mcmodel=medium -o - | FileCheck --check-prefix=CHECK-MEDANY %s +// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \ +// RUN: -mcmodel=medium -o - | FileCheck --check-prefix=CHECK-MEDANY %s + +// CHECK-MEDANY: #define __riscv_cmodel_medany 1 +// CHECK-MEDANY-NOT: __riscv_cmodel_medlow |