From f6da0096e4dcf3f7b5c8da4e8e170e88b7ebb471 Mon Sep 17 00:00:00 2001 From: Jim Lin Date: Mon, 9 Sep 2024 12:59:30 +0800 Subject: [PATCH] [RISCV] Add testcase for -mcmodel= --- clang/test/Driver/riscv-mcmodel.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 clang/test/Driver/riscv-mcmodel.c diff --git a/clang/test/Driver/riscv-mcmodel.c b/clang/test/Driver/riscv-mcmodel.c new file mode 100644 index 00000000000000..4f5fa95f59b666 --- /dev/null +++ b/clang/test/Driver/riscv-mcmodel.c @@ -0,0 +1,14 @@ +// RUN: %clang --target=riscv32 -### -c -mcmodel=small %s 2>&1 | FileCheck --check-prefix=SMALL %s +// RUN: %clang --target=riscv64 -### -c -mcmodel=small %s 2>&1 | FileCheck --check-prefix=SMALL %s + +// RUN: %clang --target=riscv32 -### -c -mcmodel=medlow %s 2>&1 | FileCheck --check-prefix=SMALL %s +// RUN: %clang --target=riscv64 -### -c -mcmodel=medlow %s 2>&1 | FileCheck --check-prefix=SMALL %s + +// RUN: %clang --target=riscv32 -### -c -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=MEDIUM %s +// RUN: %clang --target=riscv64 -### -c -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=MEDIUM %s + +// RUN: %clang --target=riscv32 -### -c -mcmodel=medany %s 2>&1 | FileCheck --check-prefix=MEDIUM %s +// RUN: %clang --target=riscv64 -### -c -mcmodel=medany %s 2>&1 | FileCheck --check-prefix=MEDIUM %s + +// SMALL: "-mcmodel=small" +// MEDIUM: "-mcmodel=medium"