Skip to content

Commit 27b4806

Browse files
Daniel Kroeningtautschnig
Daniel Kroening
authored andcommitted
goto-cl: use ms_cl_version to set target
1 parent 4c15fce commit 27b4806

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

regression/goto-cl/version/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
int main()
2+
{
3+
return 0;
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--verbosity 10
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^Visual Studio mode \d+\.\d+ (x86|x64|ARM)$
7+
--
8+
^warning: ignoring
9+
^CONVERSION ERROR$

src/goto-cc/ms_cl_mode.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Author: CM Wintersteiger, 2006
2828
#include <util/prefix.h>
2929

3030
#include "compile.h"
31+
#include "ms_cl_version.h"
3132

3233
static bool has_directory_suffix(const std::string &path)
3334
{
@@ -59,11 +60,21 @@ int ms_cl_modet::doit()
5960
const auto verbosity = eval_verbosity(
6061
cmdline.get_value("verbosity"), messaget::M_ERROR, message_handler);
6162

62-
debug() << "Visual Studio mode" << eom;
63+
ms_cl_versiont ms_cl_version;
64+
ms_cl_version.get("cl.exe");
65+
66+
debug() << "Visual Studio mode " << ms_cl_version << eom;
6367

6468
// get configuration
6569
config.set(cmdline);
6670

71+
if(ms_cl_version.target == ms_cl_versiont::targett::x86)
72+
config.ansi_c.set_32();
73+
else if(ms_cl_version.target == ms_cl_versiont::targett::ARM)
74+
config.ansi_c.set_32();
75+
else if(ms_cl_version.target == ms_cl_versiont::targett::x86)
76+
config.ansi_c.set_64();
77+
6778
config.ansi_c.mode=configt::ansi_ct::flavourt::VISUAL_STUDIO;
6879
compiler.object_file_extension="obj";
6980

0 commit comments

Comments
 (0)