forked from OSchip/llvm-project
MIPS: Pass -EB/-EL argument to the assembler according to selected endian when compile for MIPS targets.
llvm-svn: 154195
This commit is contained in:
parent
c0230d7a35
commit
2390aa1813
|
@ -5032,6 +5032,12 @@ void linuxtools::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
CmdArgs.push_back("-march");
|
||||
CmdArgs.push_back(CPUName);
|
||||
}
|
||||
|
||||
if (getToolChain().getArch() == llvm::Triple::mips ||
|
||||
getToolChain().getArch() == llvm::Triple::mips64)
|
||||
CmdArgs.push_back("-EB");
|
||||
else
|
||||
CmdArgs.push_back("-EL");
|
||||
}
|
||||
|
||||
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
// Check passing options to the assembler for MIPS targets.
|
||||
//
|
||||
// RUN: %clang -target mips-linux-gnu -### \
|
||||
// RUN: -no-integrated-as -c %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=MIPS32-EB-AS %s
|
||||
// CHECK-MIPS32-EB-AS: as{{(.exe)?}}" "-march" "mips32" "-EB"
|
||||
//
|
||||
// RUN: %clang -target mipsel-linux-gnu -### \
|
||||
// RUN: -no-integrated-as -c %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=MIPS32-EL-AS %s
|
||||
// CHECK-MIPS32-EL-AS: as{{(.exe)?}}" "-march" "mips32" "-EL"
|
||||
//
|
||||
// RUN: %clang -target mips64-linux-gnu -### \
|
||||
// RUN: -no-integrated-as -c %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=MIPS64-EB-AS %s
|
||||
// CHECK-MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-EB"
|
||||
//
|
||||
// RUN: %clang -target mips64el-linux-gnu -### \
|
||||
// RUN: -no-integrated-as -c %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=MIPS64-EL-AS %s
|
||||
// CHECK-MIPS64-EL-AS: as{{(.exe)?}}" "-march" "mips64" "-EL"
|
Loading…
Reference in New Issue