]> granicus.if.org Git - clang/commitdiff
[Mips] Pass -mmsa option to the assembler.
authorSimon Atanasyan <simon@atanasyan.com>
Tue, 26 Nov 2013 11:58:04 +0000 (11:58 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Tue, 26 Nov 2013 11:58:04 +0000 (11:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195756 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/mips-as.c

index a43f71b206c84876d6ad1dd8abd0367eb162328b..ccc59a5db5ccd98deba68d49e665998ad19e681d 100644 (file)
@@ -6187,6 +6187,13 @@ void gnutools::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
     Args.AddLastArg(CmdArgs, options::OPT_mdsp, options::OPT_mno_dsp);
     Args.AddLastArg(CmdArgs, options::OPT_mdspr2, options::OPT_mno_dspr2);
 
+    if (Arg *A = Args.getLastArg(options::OPT_mmsa, options::OPT_mno_msa)) {
+      // Do not use AddLastArg because not all versions of MIPS assembler
+      // support -mmsa / -mno-msa options.
+      if (A->getOption().matches(options::OPT_mmsa))
+        CmdArgs.push_back(Args.MakeArgString("-mmsa"));
+    }
+
     Arg *LastPICArg = Args.getLastArg(options::OPT_fPIC, options::OPT_fno_PIC,
                                       options::OPT_fpic, options::OPT_fno_pic,
                                       options::OPT_fPIE, options::OPT_fno_PIE,
index 55fa1ef927de792acd4e7c45bc2e287fcfd62a87..df925f1a17d43e94386dd127ac4ae8f516d196ca 100644 (file)
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=MIPS-MFP64 %s
 // MIPS-MFP64: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-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" "mips32" "-mabi" "32" "-EB" "-mmsa"
+//
+// RUN: %clang -target mips-linux-gnu -mmsa -mno-msa -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-NMSA %s
+// MIPS-NMSA: as{{(.exe)?}}"
+// MIPS-NMSA-NOT: "-mmsa"