From e29cdebb4b9bb435d58aec5da844f46cf78cfbe2 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 30 Jan 2012 12:25:35 +0000 Subject: [PATCH] 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 --- include/clang/Driver/Options.td | 2 +- test/Driver/target.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/Driver/target.c 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; 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" -- 2.50.1