diff options
| author | Simon Atanasyan <satanasyan@mips.com> | 2012-04-06 19:15:24 +0000 |
|---|---|---|
| committer | Simon Atanasyan <satanasyan@mips.com> | 2012-04-06 19:15:24 +0000 |
| commit | 2390aa181347991b54f06d1f74c5709291263776 (patch) | |
| tree | 7c47f41a709de73528e96e7da4ecec528e1e2c27 /clang | |
| parent | c0230d7a35fcb0c3de63aa1e2e1a845d53e400f6 (diff) | |
| download | bcm5719-llvm-2390aa181347991b54f06d1f74c5709291263776.tar.gz bcm5719-llvm-2390aa181347991b54f06d1f74c5709291263776.zip | |
MIPS: Pass -EB/-EL argument to the assembler according to selected endian when compile for MIPS targets.
llvm-svn: 154195
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 6 | ||||
| -rw-r--r-- | clang/test/Driver/mips-as.c | 21 |
2 files changed, 27 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 4c4ab7bc987..8c4378c666e 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -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, diff --git a/clang/test/Driver/mips-as.c b/clang/test/Driver/mips-as.c new file mode 100644 index 00000000000..d6282d789d7 --- /dev/null +++ b/clang/test/Driver/mips-as.c @@ -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" |

