From: Daniel Sanders Date: Fri, 8 Aug 2014 13:44:50 +0000 (+0000) Subject: [mips] Add -mabicalls/-mno-abicalls to the driver X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6d04866e139d22996e0a2f6df97ae31d88006c7;p=clang [mips] Add -mabicalls/-mno-abicalls to the driver Based on a patch by Matheus Almeida. I've added testcases and fixed a bug where the options weren't passed on to GAS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215204 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 3e2d0277fc..1dafcebf05 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -1256,6 +1256,10 @@ def mfp64 : Flag<["-"], "mfp64">, Group, def mfp32 : Flag<["-"], "mfp32">, Group, HelpText<"Use 32-bit floating point registers (MIPS only)">; def mnan_EQ : Joined<["-"], "mnan=">, Group; +def mabicalls : Flag<["-"], "mabicalls">, Group, + HelpText<"Enable SVR4-style position-independent code (Mips only)">; +def mno_abicalls : Flag<["-"], "mno-abicalls">, Group, + HelpText<"Disable SVR4-style position-independent code (Mips only)">; def mips1 : Flag<["-"], "mips1">, Alias, AliasArgs<["mips1"]>, HelpText<"Equivalent to -march=mips1">, Flags<[HelpHidden]>; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 86a05cd28c..303d11509d 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1040,6 +1040,13 @@ static void getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple, 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"); + StringRef FloatABI = getMipsFloatABI(D, Args); if (FloatABI == "soft") { // FIXME: Note, this is a hack. We need to pass the selected float @@ -7098,6 +7105,11 @@ void gnutools::Assemble::ConstructJob(Compilation &C, const JobAction &JA, 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); + // -mno-shared should be emitted unless -fpic, -fpie, -fPIC, -fPIE, // or -mshared (not implemented) is in effect. bool IsPicOrPie = false; diff --git a/test/Driver/mips-as.c b/test/Driver/mips-as.c index ecbe7d668f..1e0cab60c2 100644 --- a/test/Driver/mips-as.c +++ b/test/Driver/mips-as.c @@ -6,39 +6,39 @@ // RUN: %clang -target mipsel-linux-gnu -### \ // RUN: -no-integrated-as -c -EB %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EB-AS %s -// MIPS32R2-EB-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS32R2-EB-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // MIPS32R2-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // // RUN: %clang -target mips-linux-gnu -### \ // RUN: -no-integrated-as -fPIC -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EB-PIC %s -// MIPS32R2-EB-PIC: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-call_nonpic" "-EB" +// MIPS32R2-EB-PIC: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-call_nonpic" "-EB" // MIPS32R2-EB-PIC: "-KPIC" // // RUN: %clang -target mipsel-linux-gnu -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-DEF-EL-AS %s -// MIPS32R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EL" +// MIPS32R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EL" // // RUN: %clang -target mips64-linux-gnu -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-EB-AS %s -// MIPS64R2-EB-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS64R2-EB-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips64el-linux-gnu -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-DEF-EL-AS %s -// MIPS64R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EL" +// MIPS64R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EL" // // RUN: %clang -target mips-linux-gnu -mabi=eabi -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-EABI %s -// MIPS-EABI: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "eabi" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-EABI: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "eabi" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips64-linux-gnu -mabi=n32 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-N32 %s -// MIPS-N32: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "n32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-N32: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "n32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mipsel-linux-gnu -mabi=32 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ @@ -46,82 +46,82 @@ // RUN: %clang -target mips-linux-gnu -mabi=32 -### \ // RUN: -no-integrated-as -c %s -EL 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EL-AS %s -// MIPS32R2-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EL" +// MIPS32R2-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EL" // // RUN: %clang -target mips64el-linux-gnu -mabi=64 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-EL-AS %s -// MIPS64R2-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EL" +// MIPS64R2-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EL" // // RUN: %clang -target mips-linux-gnu -march=mips32r2 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-32R2 %s -// MIPS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips64-linux-gnu -march=octeon -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-OCTEON %s -// MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips-linux-gnu -mips1 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-1 %s -// MIPS-ALIAS-1: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-1: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips-linux-gnu -mips2 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-2 %s -// MIPS-ALIAS-2: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-2: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips-linux-gnu -mips3 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-3 %s -// MIPS-ALIAS-3: as{{(.exe)?}}" "-march" "mips3" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-3: as{{(.exe)?}}" "-march" "mips3" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips-linux-gnu -mips4 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-4 %s -// MIPS-ALIAS-4: as{{(.exe)?}}" "-march" "mips4" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-4: as{{(.exe)?}}" "-march" "mips4" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips-linux-gnu -mips5 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-5 %s -// MIPS-ALIAS-5: as{{(.exe)?}}" "-march" "mips5" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-5: as{{(.exe)?}}" "-march" "mips5" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips-linux-gnu -mips32 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32 %s -// MIPS-ALIAS-32: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-32: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips-linux-gnu -mips32r2 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R2 %s -// MIPS-ALIAS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips-linux-gnu -mips32r6 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R6 %s -// MIPS-ALIAS-32R6: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS-ALIAS-32R6: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // // RUN: %clang -target mips64-linux-gnu -mips64 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64 %s -// MIPS-ALIAS-64: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS-ALIAS-64: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips64-linux-gnu -mips64r2 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R2 %s -// MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips64-linux-gnu -mips64r6 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R6 %s -// MIPS-ALIAS-64R6: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS-ALIAS-64R6: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips-linux-gnu -mno-mips16 -mips16 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-16 %s -// MIPS-16: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mips16" +// MIPS-16: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mips16" // // RUN: %clang -target mips-linux-gnu -mips16 -mno-mips16 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ @@ -132,7 +132,7 @@ // RUN: %clang -target mips-linux-gnu -mno-micromips -mmicromips -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MICRO %s -// MIPS-MICRO: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mmicromips" +// MIPS-MICRO: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mmicromips" // // RUN: %clang -target mips-linux-gnu -mmicromips -mno-micromips -### \ // RUN: -no-integrated-as -c %s 2>&1 \ @@ -143,7 +143,7 @@ // RUN: %clang -target mips-linux-gnu -mno-dsp -mdsp -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-DSP %s -// MIPS-DSP: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mdsp" +// MIPS-DSP: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mdsp" // // RUN: %clang -target mips-linux-gnu -mdsp -mno-dsp -### \ // RUN: -no-integrated-as -c %s 2>&1 \ @@ -154,7 +154,7 @@ // RUN: %clang -target mips-linux-gnu -mno-dspr2 -mdspr2 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-DSPR2 %s -// MIPS-DSPR2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mdspr2" +// MIPS-DSPR2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mdspr2" // // RUN: %clang -target mips-linux-gnu -mdspr2 -mno-dspr2 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ @@ -165,7 +165,7 @@ // RUN: %clang -target mips-linux-gnu -mnan=legacy -mnan=2008 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-NAN2008 %s -// MIPS-NAN2008: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mnan=2008" +// MIPS-NAN2008: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mnan=2008" // // RUN: %clang -target mips-linux-gnu -mnan=2008 -mnan=legacy -### \ // RUN: -no-integrated-as -c %s 2>&1 \ @@ -176,22 +176,22 @@ // RUN: %clang -target mips-linux-gnu -mfp64 -mfpxx -mfp32 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MFP32 %s -// MIPS-MFP32: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfp32" +// MIPS-MFP32: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mfp32" // // RUN: %clang -target mips-linux-gnu -mfp32 -mfp64 -mfpxx -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MFPXX %s -// MIPS-MFPXX: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfpxx" +// MIPS-MFPXX: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mfpxx" // // RUN: %clang -target mips-linux-gnu -mfpxx -mfp32 -mfp64 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MFP64 %s -// MIPS-MFP64: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfp64" +// MIPS-MFP64: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mfp64" // // RUN: %clang -target mips-linux-gnu -mno-msa -mmsa -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MSA %s -// MIPS-MSA: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mmsa" +// MIPS-MSA: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" "-mmsa" // // RUN: %clang -target mips-linux-gnu -mmsa -mno-msa -### \ // RUN: -no-integrated-as -c %s 2>&1 \ @@ -204,43 +204,43 @@ // when the CPU name is absent from a StringSwitch in getMipsCPUAndABI() // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips1 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS1-EB-AS %s -// MIPS1-EB-AS: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS1-EB-AS: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // MIPS1-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips2 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS2-EB-AS %s -// MIPS2-EB-AS: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS2-EB-AS: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // MIPS2-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips3 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS3-EB-AS %s -// MIPS3-EB-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS3-EB-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips4 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS4-EB-AS %s -// MIPS4-EB-AS: as{{(.exe)?}}" "-march" "mips4" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS4-EB-AS: as{{(.exe)?}}" "-march" "mips4" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips5 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS5-EB-AS %s -// MIPS5-EB-AS: as{{(.exe)?}}" "-march" "mips5" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS5-EB-AS: as{{(.exe)?}}" "-march" "mips5" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips32 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS32-EB-AS %s -// MIPS32-EB-AS: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS32-EB-AS: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // MIPS32-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips32r6 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS32R6-EB-AS %s -// MIPS32R6-EB-AS: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// MIPS32R6-EB-AS: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mabicalls" "-mno-shared" "-call_nonpic" "-EB" // MIPS32R6-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS64-EB-AS %s -// MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64r6 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS64R6-EB-AS %s -// MIPS64R6-EB-AS: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// MIPS64R6-EB-AS: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mabicalls" "-mno-shared" "-KPIC" "-EB" // // RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msoft-float -mhard-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=HARDFLOAT --implicit-check-not=-msoft-float %s @@ -261,3 +261,13 @@ // RUN: | FileCheck -check-prefix=NOODDSPREG --implicit-check-not=-modd-spreg %s // NOODDSPREG: as{{(.exe)?}}" // NOODDSPREG: -mno-odd-spreg +// +// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -mno-abicalls -mabicalls -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ABICALLS --implicit-check-not=-mno-abicalls %s +// ABICALLS: as{{(.exe)?}}" +// ABICALLS: -mabicalls +// +// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -mabicalls -mno-abicalls -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=NOABICALLS --implicit-check-not=-mabicalls %s +// NOABICALLS: as{{(.exe)?}}" +// NOABICALLS: "-mabicalls" "-mno-abicalls" diff --git a/test/Driver/mips-features.c b/test/Driver/mips-features.c index 03cc0fd7e3..964e88bfb8 100644 --- a/test/Driver/mips-features.c +++ b/test/Driver/mips-features.c @@ -1,5 +1,17 @@ // 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" +// +// -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" +// // -mips16 // RUN: %clang -target mips-linux-gnu -### -c %s \ // RUN: -mno-mips16 -mips16 2>&1 \ diff --git a/test/Driver/mips-integrated-as.s b/test/Driver/mips-integrated-as.s index c3b1db391e..398ea458dc 100644 --- a/test/Driver/mips-integrated-as.s +++ b/test/Driver/mips-integrated-as.s @@ -205,3 +205,15 @@ // FPXX-ODDSPREG: -cc1as // 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" + +// 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"