aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-01-30 12:25:35 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-01-30 12:25:35 +0000
commite29cdebb4b9bb435d58aec5da844f46cf78cfbe2 (patch)
treeca943ec7d0914185866cd699ff268ee048b4f202
parent30c5f1444d0c46c32dbb50820469d12fa89d7b53 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149244 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/Options.td2
-rw-r--r--test/Driver/target.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
index ad36b0280f..f0c7f059e3 100644
--- a/include/clang/Driver/Options.td
+++ b/include/clang/Driver/Options.td
@@ -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>;
diff --git a/test/Driver/target.c b/test/Driver/target.c
new file mode 100644
index 0000000000..09f1a9b021
--- /dev/null
+++ b/test/Driver/target.c
@@ -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"