Skip to content

Commit ea156d9

Browse files
authored
Merge pull request #5242 from karkhaz/kk-allow-old-flag
Allow old --export-function-local-symbols flag
2 parents 1f2f1fa + e58901a commit ea156d9

File tree

5 files changed

+35
-4
lines changed

5 files changed

+35
-4
lines changed

regression/goto-cc-file-local/chain.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ if is_in wall "$ALL_ARGS"; then
4747
fi
4848
fi
4949

50+
export_flag=""
51+
if is_in old-flag "$ALL_ARGS"; then
52+
export_flag="--export-function-local-symbols"
53+
else
54+
export_flag="--export-file-local-symbols"
55+
fi
56+
5057
cnt=0
5158
for src in ${SRC}; do
5259
cnt=$((cnt + 1))
@@ -63,7 +70,7 @@ for src in ${SRC}; do
6370

6471
if [[ "${is_windows}" == "true" ]]; then
6572
"${goto_cc}" \
66-
--export-file-local-symbols \
73+
${export_flag} \
6774
--verbosity 10 \
6875
${wall} \
6976
${suffix} \
@@ -72,7 +79,7 @@ for src in ${SRC}; do
7279

7380
else
7481
"${goto_cc}" \
75-
--export-file-local-symbols \
82+
${export_flag} \
7683
--verbosity 10 \
7784
${wall} \
7885
${suffix} \
@@ -86,7 +93,7 @@ if is_in final-link "$ALL_ARGS"; then
8693
rm -f ${OUT_FILE}
8794
if [[ "${is_windows}" == "true" ]]; then
8895
"${goto_cc}" \
89-
--export-file-local-symbols \
96+
${export_flag} \
9097
--verbosity 10 \
9198
${wall} \
9299
${suffix} \
@@ -95,7 +102,7 @@ if is_in final-link "$ALL_ARGS"; then
95102

96103
else
97104
"${goto_cc}" \
98-
--export-file-local-symbols \
105+
${export_flag} \
99106
--verbosity 10 \
100107
${wall} \
101108
${suffix} \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
static int foo()
2+
{
3+
return 1;
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int __CPROVER_file_local_foo_c_foo();
2+
3+
int main()
4+
{
5+
int x = __CPROVER_file_local_foo_c_foo();
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
final-link assertion-check old-flag
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
^The `--export-function-local-symbols` flag is deprecated. Please use `--export-file-local-symbols` instead.$
8+
--
9+
^warning: ignoring
10+
^\*\*\*\* WARNING: no body for function
11+
--
12+
Check that goto-cc emits a warning when using the old command line flag

src/goto-cc/gcc_cmdline.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const char *goto_cc_options_without_argument[]=
5353
"--validate-goto-model",
5454
"-?",
5555
"--export-file-local-symbols",
56+
// This is deprecated. Currently prints out a deprecation warning.
57+
"--export-function-local-symbols",
5658
nullptr
5759
};
5860

0 commit comments

Comments
 (0)