[MIPS] Add -mxgot/-mno-xgot command line options
to enable/disable support of GOT larger than 64k. llvm-svn: 169098
This commit is contained in:
parent
cfe5aedd5a
commit
2eaec51f66
|
@ -875,6 +875,8 @@ def mf16c : Flag<["-"], "mf16c">, Group<m_x86_Features_Group>;
|
|||
def mrtm : Flag<["-"], "mrtm">, Group<m_x86_Features_Group>;
|
||||
def mips16 : Flag<["-"], "mips16">, Group<m_Group>;
|
||||
def mno_mips16 : Flag<["-"], "mno-mips16">, Group<m_Group>;
|
||||
def mxgot : Flag<["-"], "mxgot">, Group<m_Group>;
|
||||
def mno_xgot : Flag<["-"], "mno-xgot">, Group<m_Group>;
|
||||
def mdsp : Flag<["-"], "mdsp">, Group<m_Group>;
|
||||
def mno_dsp : Flag<["-"], "mno-dsp">, Group<m_Group>;
|
||||
def mdspr2 : Flag<["-"], "mdspr2">, Group<m_Group>;
|
||||
|
|
|
@ -990,6 +990,13 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
|
|||
options::OPT_mdspr2, options::OPT_mno_dspr2,
|
||||
"dspr2");
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_mxgot, options::OPT_mno_xgot)) {
|
||||
if (A->getOption().matches(options::OPT_mxgot)) {
|
||||
CmdArgs.push_back("-mllvm");
|
||||
CmdArgs.push_back("-mxgot");
|
||||
}
|
||||
}
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_G)) {
|
||||
StringRef v = A->getValue();
|
||||
CmdArgs.push_back("-mllvm");
|
||||
|
|
|
@ -38,6 +38,18 @@
|
|||
// RUN: | FileCheck --check-prefix=CHECK-NOMDSPR2 %s
|
||||
// CHECK-NOMDSPR2: "-target-feature" "-dspr2"
|
||||
//
|
||||
// -mxgot
|
||||
// RUN: %clang -target mips-linux-gnu -### -c %s \
|
||||
// RUN: -mno-xgot -mxgot 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-XGOT %s
|
||||
// CHECK-XGOT: "-mllvm" "-mxgot"
|
||||
//
|
||||
// -mno-xgot
|
||||
// RUN: %clang -target mips-linux-gnu -### -c %s \
|
||||
// RUN: -mxgot -mno-xgot 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-NOXGOT %s
|
||||
// CHECK-NOXGOT-NOT: "-mllvm" "-mxgot"
|
||||
//
|
||||
// -G
|
||||
// RUN: %clang -target mips-linux-gnu -### -c %s \
|
||||
// RUN: -G 16 2>&1 \
|
||||
|
|
Loading…
Reference in New Issue