[driver] Make -serialize-diagnostics (one dash) and alias for
--serialize-diagnostics.
rdar://11734800


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159208 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
index b6d352a..16a4366 100644
--- a/include/clang/Driver/Options.td
+++ b/include/clang/Driver/Options.td
@@ -1123,6 +1123,7 @@
 def _write_user_dependencies : Flag<"--write-user-dependencies">, Alias<MMD>;
 def _ : Joined<"--">, Flags<[Unsupported]>;
 def mieee_rnd_near : Flag<"-mieee-rnd-near">, Group<m_hexagon_Features_Group>;
+def serialize_diags : Separate<"-serialize-diagnostics">, Alias<_serialize_diags>;
 
 // Special internal option to handle -Xlinker --no-demangle.
 def Z_Xlinker__no_demangle : Flag<"-Z-Xlinker-no-demangle">,
diff --git a/test/Driver/apple-kext-i386.cpp b/test/Driver/apple-kext-i386.cpp
index c11a136..eb9f957 100644
--- a/test/Driver/apple-kext-i386.cpp
+++ b/test/Driver/apple-kext-i386.cpp
@@ -41,6 +41,11 @@
 // CHECK-UNSUPPORTED2: cc1plus"
 // CHECK-UNSUPPORTED2-NOT: "-Wconstant-logical-operand"
 
+// Check that -serialize-diagnostics does not cause an "argument unused" error.
+// RUN: %clang -target i386-apple-darwin10 \
+// RUN:   -Wall -fapple-kext -### -serialize-diagnostics %t.dia -c %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=CHECK-UNUSED %s
+
 // Check that --serialize-diagnostics does not cause an "argument unused" error.
 // RUN: %clang -target i386-apple-darwin10 \
 // RUN:   -Wall -fapple-kext -### --serialize-diagnostics %t.dia -c %s 2>&1 | \