'-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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149244
91177308-0d34-0410-b5e6-
96231b3b80d8
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>;
--- /dev/null
+// 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"