From 5bfc796a03e45c23e498315b7b49a5c46fe77446 Mon Sep 17 00:00:00 2001 From: Hans Wennborg <hans@hanshq.net> Date: Mon, 9 Sep 2013 19:04:49 +0000 Subject: [PATCH] clang-cl: parse (but don't support) the /o flag Apparently folks run into this (PR17097). The flag is not supported by MSVC either, but we should parse it so we don't get confused when it occurs. This changes the clang-cl output for "clang-cl /c /o foo.obj" from: clang-cl.exe: error: no such file or directory: '/o' clang-cl.exe: error: no such file or directory: 'foo.obj' to: clang-cl.exe: warning: argument unused during compilation: '/o bajs.obj' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190323 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/CLCompatOptions.td | 1 + test/Driver/cl-options.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/clang/Driver/CLCompatOptions.td b/include/clang/Driver/CLCompatOptions.td index a520046d45b..574830c07f8 100644 --- a/include/clang/Driver/CLCompatOptions.td +++ b/include/clang/Driver/CLCompatOptions.td @@ -143,6 +143,7 @@ def _SLASH_Gy : CLFlag<"Gy">; def _SLASH_Gy_ : CLFlag<"Gy-">; def _SLASH_GZ : CLFlag<"GZ">; def _SLASH_MP : CLJoined<"MP">; +def _SLASH_o : CLJoinedOrSeparate<"o">; def _SLASH_w : CLJoined<"w">; def _SLASH_Za : CLFlag<"Za">; def _SLASH_Zc : CLJoined<"Zc:">; diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index dc33db61b5a..ab0320cf6e9 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -107,6 +107,7 @@ // (/Zs is for syntax-only) // RUN: %clang_cl /Zs /EHsc /Fdfoo /fp:precise /Gd /GL /GL- -- %s 2>&1 // RUN: %clang_cl /Zs /Gm /Gm- /GS /Gy /Gy- /GZ -- %s 2>&1 +// RUN: %clang_cl /Zs /ofoo.obj /o foo.obj -- %s 2>&1 // RUN: %clang_cl /Zs /wfoo /Zc:wchar_t- -- %s 2>&1 // RUN: %clang_cl /Zs /ZI /Zi /MP -- %s 2>&1 -- GitLab