Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1531,7 +1531,7 @@ "system header.">; def : Separate<["--"], "no-system-header-prefix">, Alias; def s : Flag<["-"], "s">; -def target : Joined<["--"], "target=">, Flags<[DriverOption, CoreOption]>, +def target : Joined<["-", "--"], "target=">, Flags<[DriverOption, CoreOption]>, HelpText<"Generate code for the given target">; def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[DriverOption]>, HelpText<"Use the gcc toolchain at the given directory">; @@ -1704,7 +1704,7 @@ // aliases for options that are spelled using the more common Unix / GNU flag // style of double-dash and equals-joined flags. def gcc_toolchain_legacy_spelling : Separate<["-"], "gcc-toolchain">, Alias; -def target_legacy_spelling : Separate<["-"], "target">, Alias; +def target_legacy_spelling : Separate<["-", "--"], "target">, Alias; // Special internal option to handle -Xlinker --no-demangle. def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">, Index: test/Driver/target.c =================================================================== --- test/Driver/target.c +++ test/Driver/target.c @@ -7,3 +7,9 @@ // Also check that the legacy spelling works. // RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \ // RUN: -o %t.o -### 2>&1 | FileCheck %s +// +// RUN: %clang -no-canonical-prefixes -target=unknown-unknown-unknown -c %s \ +// RUN: -o %t.o -### 2>&1 | FileCheck %s +// +// RUN: %clang -no-canonical-prefixes --target unknown-unknown-unknown -c %s \ +// RUN: -o %t.o -### 2>&1 | FileCheck %s