[RISCV] Add -mrelax/-mno-relax flags to enable/disable RISCV linker relaxation

Differential Revision: https://reviews.llvm.org/D44888

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333385 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Driver/riscv-features.c b/test/Driver/riscv-features.c
index 565596c..95f84f3 100644
--- a/test/Driver/riscv-features.c
+++ b/test/Driver/riscv-features.c
@@ -2,3 +2,12 @@
 // RUN: %clang -target riscv64-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s
 
 // CHECK: fno-signed-char
+
+// 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
+// RUN: %clang -target riscv32-unknown-elf -### %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
+
+// RELAX: "-target-feature" "+relax"
+// NO-RELAX: "-target-feature" "-relax"
+// DEFAULT-NOT: "-target-feature" "+relax"
+// DEFAULT-NOT: "-target-feature" "-relax"