gcc mode: error in case multiple files are given with -c and -o

This commit is contained in:
Daniel Kroening 2018-07-24 22:27:28 +01:00
parent d42054a29b
commit 694daaf328
4 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,7 @@
CORE
-c main1.c main2.c -o outfile
^EXIT=1$
^SIGNAL=0$
^cannot specify -o with -c with multiple files$
--

View File

@ -0,0 +1 @@
// blank

View File

@ -0,0 +1 @@
// blank

View File

@ -723,6 +723,14 @@ int gcc_modet::doit()
}
}
if(
cmdline.isset('o') && cmdline.isset('c') &&
compiler.source_files.size() >= 2)
{
error() << "cannot specify -o with -c with multiple files" << eom;
return 1; // to match gcc's behaviour
}
// Revert to gcc in case there is no source to compile
// and no binary to link.