diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -662,7 +662,8 @@ if (D.IsFlangMode() && getDriver().ShouldUseFlangCompiler(JA)) return getFlang(); if (getDriver().ShouldUseClangCompiler(JA)) return getClang(); Action::ActionClass AC = JA.getKind(); - if (AC == Action::AssembleJobClass && useIntegratedAs()) + if (AC == Action::AssembleJobClass && useIntegratedAs() && + !getTriple().isOSAIX()) return getClangAs(); return getTool(AC); } diff --git a/clang/test/Driver/aix-assembler.s b/clang/test/Driver/aix-assembler.s new file mode 100644 --- /dev/null +++ b/clang/test/Driver/aix-assembler.s @@ -0,0 +1,30 @@ +// Check powerpc64-ibm-aix7.1.0.0, 64-bit. +// RUN: %clang %s -### -c -fintegrated-as 2>&1 \ +// RUN: --target=powerpc64-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefixes=AS64,CHECK %s + +// RUN: %clang %s -### -c 2>&1 \ +// RUN: --target=powerpc64-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefixes=AS64,CHECK %s + +// RUN: %clang %s -### -c -fno-integrated-as 2>&1 \ +// RUN: --target=powerpc64-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefixes=AS64,CHECK %s + +// Check powerpc-ibm-aix7.1.0.0, 32-bit. +// RUN: %clang %s -### -c -fintegrated-as 2>&1 \ +// RUN: --target=powerpc-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefixes=AS32,CHECK %s + +// RUN: %clang %s -### -c 2>&1 \ +// RUN: --target=powerpc-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefixes=AS32,CHECK %s + +// RUN: %clang %s -### -c 2>&1 -fno-integrated-as \ +// RUN: --target=powerpc-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefixes=AS32,CHECK %s + +// CHECK: "{{.*}}as{{(.exe)?}}" +// AS32: "-a32" +// AS64: "-a64" +// CHECK: "-many"