Index: clang/lib/Driver/ToolChains/Gnu.cpp =================================================================== --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -731,6 +731,7 @@ case llvm::Triple::ppc: { CmdArgs.push_back("-a32"); CmdArgs.push_back("-mppc"); + CmdArgs.push_back("-mbig-endian"); CmdArgs.push_back( ppc::getPPCAsmModeForCPU(getCPUName(Args, getToolChain().getTriple()))); break; @@ -746,6 +747,7 @@ case llvm::Triple::ppc64: { CmdArgs.push_back("-a64"); CmdArgs.push_back("-mppc64"); + CmdArgs.push_back("-mbig-endian"); CmdArgs.push_back( ppc::getPPCAsmModeForCPU(getCPUName(Args, getToolChain().getTriple()))); break; Index: clang/test/Driver/ppc-features.cpp =================================================================== --- clang/test/Driver/ppc-features.cpp +++ clang/test/Driver/ppc-features.cpp @@ -156,14 +156,25 @@ // CHECK-NOSPE: "-target-feature" "-spe" // Assembler features -// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s -// CHECK_BE_AS_ARGS: "-mppc64" -// CHECK_BE_AS_ARGS: "-many" - -// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_LE_AS_ARGS %s -// CHECK_LE_AS_ARGS: "-mppc64" -// CHECK_LE_AS_ARGS: "-mlittle-endian" -// CHECK_LE_AS_ARGS: "-mpower8" +// RUN: %clang -target powerpc-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_32_BE_AS_ARGS %s +// CHECK_32_BE_AS_ARGS: "-mppc" +// CHECK_32_BE_AS_ARGS-SAME: "-mbig-endian" +// CHECK_32_BE_AS_ARGS-SAME: "-many" + +// RUN: %clang -target powerpcle-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_32_LE_AS_ARGS %s +// CHECK_32_LE_AS_ARGS: "-mppc" +// CHECK_32_LE_AS_ARGS-SAME: "-mlittle-endian" +// CHECK_32_LE_AS_ARGS-SAME: "-many" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_64_BE_AS_ARGS %s +// CHECK_64_BE_AS_ARGS: "-mppc64" +// CHECK_64_BE_AS_ARGS-SAME: "-mbig-endian" +// CHECK_64_BE_AS_ARGS-SAME: "-many" + +// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_64_LE_AS_ARGS %s +// CHECK_64_LE_AS_ARGS: "-mppc64" +// CHECK_64_LE_AS_ARGS-SAME: "-mlittle-endian" +// CHECK_64_LE_AS_ARGS-SAME: "-mpower8" // OpenMP features // RUN: %clang -target powerpc-unknown-linux-gnu %s -### -fopenmp=libomp -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_OPENMP_TLS %s