Skip to content

Update test to match Visual-Studio behaviour #2687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regression/goto-cl/Fo/Fo-directory.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE

--verbosity 10 /c main1.c main2.c /Fo dir
--verbosity 10 /c main1.c main2.c /Fodir/
^EXIT=0$
^SIGNAL=0$
--
Expand Down
12 changes: 12 additions & 0 deletions regression/goto-cl/Fo/Fo-no-directory.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CORE

--verbosity 10 /c main1.c main2.c /Fodir
^EXIT=64$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
--
Visual Studio expects a / or \ at the end of a directory name to be treating it
as a directory. Using multiple translation units without a target directory is
not permitted.
10 changes: 10 additions & 0 deletions src/goto-cc/ms_cl_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ int ms_cl_modet::doit()
compiler.output_file_object = Fo_value;
}

if(
compiler.mode == compilet::COMPILE_ONLY &&
cmdline.args.size() > 1 &&
compiler.output_directory_object.empty())
{
error() << "output directory required for /c with multiple input files"
<< eom;
return EX_USAGE;
}

if(cmdline.isset("Fe"))
{
compiler.output_file_executable=cmdline.get_value("Fe");
Expand Down