summaryrefslogtreecommitdiff
path: root/test/Driver/riscv-gnutools.c
diff options
context:
space:
mode:
authorAna Pazos <apazos@codeaurora.org>2018-01-31 18:11:09 +0000
committerAna Pazos <apazos@codeaurora.org>2018-01-31 18:11:09 +0000
commit717663c200270267d7c34799dd3b8e1a62ae3c76 (patch)
treef3473052251944957cde5b856fa3efba4838e6fc /test/Driver/riscv-gnutools.c
parent251524ebd8c346a936f0e74b09d609d49fbaae4a (diff)
downloadclang-717663c200270267d7c34799dd3b8e1a62ae3c76.tar.gz
Revert "Revert rC322769: [RISCV] Propagate -mabi and -march values to GNU assembler."
Summary: Bringing back the code change and simplified test cases to test 32/64 bit targets. Reviewers: asb, yroux, inouehrs, mgrang Reviewed By: yroux, inouehrs Subscribers: cfe-commits, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD Differential Revision: https://reviews.llvm.org/D42666 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/riscv-gnutools.c')
-rw-r--r--test/Driver/riscv-gnutools.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Driver/riscv-gnutools.c b/test/Driver/riscv-gnutools.c
new file mode 100644
index 0000000000..afcb5052aa
--- /dev/null
+++ b/test/Driver/riscv-gnutools.c
@@ -0,0 +1,19 @@
+// Check gnutools are invoked with propagated values for -mabi and -march.
+
+// RUN: %clang -target riscv32 -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP32 %s
+
+// RUN: %clang -target riscv32 -fno-integrated-as -march=rv32g %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP32-MARCH-G %s
+
+// RUN: %clang -target riscv64 -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP64 %s
+
+// RUN: %clang -target riscv64 -fno-integrated-as -march=rv64g %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP64-MARCH-G %s
+
+// MABI-ILP32: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32"
+// MABI-ILP32-MARCH-G: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32" "-march" "rv32g"
+
+// MABI-ILP64: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64"
+// MABI-ILP64-MARCH-G: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64" "-march" "rv64g"