Also added the testcase that should have been in r215194.
This behaviour has surprised me a few times now. The problem is that the
generated MipsSubtarget::ParseSubtargetFeatures() contains code like this:
if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true;
so '-abicalls' means 'leave it at the default' and '+abicalls' means 'set it to
true'. In this case, (and the similar -modd-spreg case) I'd like the code to be
IsABICalls = (Bits & Mips::FeatureABICalls) != 0;
or possibly:
if ((Bits & Mips::FeatureABICalls) != 0)
IsABICalls = true;
else
IsABICalls = false;
and preferably arrange for 'Bits & Mips::FeatureABICalls' to be true by default
(on some triples).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215211
91177308-0d34-0410-b5e6-
96231b3b80d8
Features.push_back("-n64");
Features.push_back(Args.MakeArgString(ABIFeature));
- // Preserve the current default.
- // FIXME: This ought to depend on Triple.getOS()
- Features.push_back(Args.MakeArgString("+abicalls"));
-
- AddTargetFeature(Args, Features, options::OPT_mabicalls,
- options::OPT_mno_abicalls, "abicalls");
+ AddTargetFeature(Args, Features, options::OPT_mno_abicalls,
+ options::OPT_mabicalls, "noabicalls");
StringRef FloatABI = getMipsFloatABI(D, Args);
if (FloatABI == "soft") {
CmdArgs.push_back("-mabi");
CmdArgs.push_back(ABIName.data());
- // Preserve the current default
- // FIXME: This ought to depend on Triple.getOS().
CmdArgs.push_back("-mabicalls");
Args.AddLastArg(CmdArgs, options::OPT_mabicalls, options::OPT_mno_abicalls);
// Check handling MIPS specific features options.
//
// -mabicalls
-// RUN: %clang -target mips-linux-gnu -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-MABICALLS %s
// RUN: %clang -target mips-linux-gnu -### -c %s -mno-abicalls -mabicalls 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MABICALLS %s
-// CHECK-MABICALLS: "-target-feature" "+abicalls"
+// CHECK-MABICALLS: "-target-feature" "-noabicalls"
//
// -mno-abicalls
// RUN: %clang -target mips-linux-gnu -### -c %s -mabicalls -mno-abicalls 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MNOABICALLS %s
-// CHECK-MNOABICALLS: "-target-feature" "-abicalls"
+// CHECK-MNOABICALLS: "-target-feature" "+noabicalls"
//
// -mips16
// RUN: %clang -target mips-linux-gnu -### -c %s \
// FPXX-ODDSPREG: "-target-feature" "+fpxx"
// FPXX-ODDSPREG: "-target-feature" "-nooddspreg"
-// RUN: %clang -target mips-linux-gnu -### -fintegrated-as -c %s 2>&1 | \
-// RUN: FileCheck -check-prefix=ABICALLS-ON %s
// RUN: %clang -target mips-linux-gnu -### -fintegrated-as -c %s -mabicalls 2>&1 | \
// RUN: FileCheck -check-prefix=ABICALLS-ON %s
// ABICALLS-ON: -cc1as
-// ABICALLS-ON: "-target-feature" "+abicalls"
+// ABICALLS-ON: "-target-feature" "-noabicalls"
// RUN: %clang -target mips-linux-gnu -### -fintegrated-as -c %s -mno-abicalls 2>&1 | \
// RUN: FileCheck -check-prefix=ABICALLS-OFF %s
// ABICALLS-OFF: -cc1as
-// ABICALLS-OFF: "-target-feature" "-abicalls"
+// ABICALLS-OFF: "-target-feature" "+noabicalls"