Fix yet another issue introduced when renaming '-ccc-host-triple' to

'-target'. The original flag was part of a flag group that marked it as
driver-only. The new flag didn't ever get equivalent treatment. This
caused the '-target' flag to get passed down to any raw GCC invocation.
Marking it as a driver option fixes this and PR11875.

llvm-svn: 149244
This commit is contained in:
Chandler Carruth 2012-01-30 12:25:35 +00:00
parent 7a36f9d399
commit 4c727853ed
2 changed files with 12 additions and 1 deletions

View File

@ -756,7 +756,7 @@ def stdlib_EQ : Joined<"-stdlib=">;
def sub__library : JoinedOrSeparate<"-sub_library">;
def sub__umbrella : JoinedOrSeparate<"-sub_umbrella">;
def s : Flag<"-s">;
def target : Separate<"-target">,
def target : Separate<"-target">, Flags<[DriverOption]>,
HelpText<"Generate code for the given target">;
// We should deprecate the use of -ccc-host-triple, and then remove.
def ccc_host_triple : Separate<"-ccc-host-triple">, Alias<target>;

View File

@ -0,0 +1,11 @@
// RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \
// RUN: -o %t.o -### 2>&1 | FileCheck %s
//
// Ensure we get a crazy triple here as we asked for one.
// CHECK: Target: unknown-unknown-unknown
//
// Also, ensure we don't blindly hand our target selection logic down to GCC.
// CHECK: "{{.*}}gcc"
// CHECK-NOT: "-target"
// CHECK-NOT: "unknown-unknown-unknown"
// CHECK: "-x" "assembler"