Skip to content

Commit 1156930

Browse files
author
Daniel Kroening
authored
Merge pull request #1244 from tautschnig/goto-gcc-at-fix
goto-gcc: Add @<file> arguments to the original command line
2 parents 706e391 + 5109eab commit 1156930

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

regression/goto-gcc/at_files/args

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
other.c

regression/goto-gcc/at_files/main.c

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int foo();
2+
3+
int main()
4+
{
5+
return foo();
6+
}

regression/goto-gcc/at_files/other.c

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
int foo()
2+
{
3+
return 1;
4+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
@args
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

src/goto-cc/gcc_cmdline.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ bool gcc_cmdlinet::parse_arguments(
256256
line.erase(0, line.find_first_not_of("\t "));
257257

258258
if(!line.empty())
259-
parse_specs_line(line);
259+
parse_specs_line(line, false);
260260
}
261261

262262
continue;
@@ -432,7 +432,7 @@ bool gcc_cmdlinet::parse_arguments(
432432
}
433433

434434
/// Parse GCC spec files https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
435-
void gcc_cmdlinet::parse_specs_line(const std::string &line)
435+
void gcc_cmdlinet::parse_specs_line(const std::string &line, bool in_spec_file)
436436
{
437437
// initial whitespace has been stripped
438438
assert(!line.empty());
@@ -448,7 +448,7 @@ void gcc_cmdlinet::parse_specs_line(const std::string &line)
448448
args.push_back(line.substr(arg_start, arg_end-arg_start));
449449
}
450450

451-
parse_arguments(args, true);
451+
parse_arguments(args, in_spec_file);
452452
}
453453

454454
/// Parse GCC spec files https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
@@ -477,7 +477,7 @@ void gcc_cmdlinet::parse_specs()
477477
line=="*link:"))
478478
use_line=true;
479479
else if(use_line)
480-
parse_specs_line(line);
480+
parse_specs_line(line, true);
481481
else
482482
{
483483
// TODO need message interface

src/goto-cc/gcc_cmdline.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class gcc_cmdlinet:public goto_cc_cmdlinet
3131

3232
bool parse_arguments(const argst &args, bool in_spec_file);
3333
void parse_specs();
34-
void parse_specs_line(const std::string &line);
34+
void parse_specs_line(const std::string &line, bool in_spec_file);
3535
};
3636

3737
#endif // CPROVER_GOTO_CC_GCC_CMDLINE_H

0 commit comments

Comments
 (0)