[driver][mips] Pass long-calls feature flag to the MIPS backend

Check the `-mlong-calls` command line option and pass the `long-calls`
feature flag to the backend. Handling of this feature flag in the backend
needs to be implemented by a separate commit.

llvm-svn: 307386
This commit is contained in:
Simon Atanasyan 2017-07-07 10:35:33 +00:00
parent 5ff6b8655a
commit df406d18aa
2 changed files with 13 additions and 0 deletions

View File

@ -299,6 +299,8 @@ void mips::getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple,
options::OPT_modd_spreg, "nooddspreg");
AddTargetFeature(Args, Features, options::OPT_mno_madd4, options::OPT_mmadd4,
"nomadd4");
AddTargetFeature(Args, Features, options::OPT_mlong_calls,
options::OPT_mno_long_calls, "long-calls");
}
mips::NanEncoding mips::getSupportedNanEncoding(StringRef &CPU) {

View File

@ -247,3 +247,14 @@
// RUN: | FileCheck --check-prefix=CHECK-IMG-SINGLEFLOAT-FPXX %s
// CHECK-IMG-SINGLEFLOAT-FPXX: "-target-feature" "+single-float"
// CHECK-IMG-SINGLEFLOAT-FPXX: "-target-feature" "+fpxx"
// -mlong-call
// RUN: %clang -target mips-img-linux-gnu -### -c %s -mlong-calls 2>&1 \
// RUN: | FileCheck --check-prefix=LONG-CALLS-ON %s
// RUN: %clang -target mips-img-linux-gnu -### -c %s -mno-long-calls 2>&1 \
// RUN: | FileCheck --check-prefix=LONG-CALLS-OFF %s
// RUN: %clang -target mips-img-linux-gnu -### -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=LONG-CALLS-DEF %s
// LONG-CALLS-ON: "-target-feature" "+long-calls"
// LONG-CALLS-OFF: "-target-feature" "-long-calls"
// LONG-CALLS-DEF-NOT: "long-calls"