File tree Expand file tree Collapse file tree 5 files changed +86
-32
lines changed
regression/goto-cc-file-local
combined-compile-and-link Expand file tree Collapse file tree 5 files changed +86
-32
lines changed Original file line number Diff line number Diff line change 54
54
export_flag=" --export-file-local-symbols"
55
55
fi
56
56
57
- cnt=0
58
- for src in ${SRC} ; do
59
- cnt=$(( cnt + 1 ))
60
- out_suffix=" "
61
- if is_in out-file-counter " $ALL_ARGS " ; then
62
- out_suffix=" _$cnt "
63
- if is_in suffix " $ALL_ARGS " ; then
64
- suffix=" --mangle-suffix custom_$cnt "
57
+ OUT_FILE=" main.gb"
58
+ if is_in compile-and-link " $ALL_ARGS " ; then
59
+ if [[ " ${is_windows} " == " true" ]]; then
60
+ " ${goto_cc} " \
61
+ ${export_flag} \
62
+ --verbosity 10 \
63
+ ${wall} \
64
+ ${suffix} \
65
+ ${SRC} \
66
+ /Fe" ${OUT_FILE} "
67
+
68
+ else
69
+ " ${goto_cc} " \
70
+ ${export_flag} \
71
+ --verbosity 10 \
72
+ ${wall} \
73
+ ${suffix} \
74
+ ${SRC} \
75
+ -o " ${OUT_FILE} "
65
76
fi
66
- fi
67
-
68
- base=${src% .c}
69
- OUT_FILE=$( basename " ${base}${out_suffix} " ) " .gb"
70
-
71
- if [[ " ${is_windows} " == " true" ]]; then
72
- " ${goto_cc} " \
73
- ${export_flag} \
74
- --verbosity 10 \
75
- ${wall} \
76
- ${suffix} \
77
- /c " ${base} .c" \
78
- /Fo" ${OUT_FILE} "
79
-
80
- else
81
- " ${goto_cc} " \
82
- ${export_flag} \
83
- --verbosity 10 \
84
- ${wall} \
85
- ${suffix} \
86
- -c " ${base} .c" \
87
- -o " ${OUT_FILE} "
88
- fi
89
- done
77
+ else
78
+ cnt=0
79
+ for src in ${SRC} ; do
80
+ cnt=$(( cnt + 1 ))
81
+ out_suffix=" "
82
+ if is_in out-file-counter " $ALL_ARGS " ; then
83
+ out_suffix=" _$cnt "
84
+ if is_in suffix " $ALL_ARGS " ; then
85
+ suffix=" --mangle-suffix custom_$cnt "
86
+ fi
87
+ fi
88
+
89
+ base=${src% .c}
90
+ OUT_FILE=$( basename " ${base}${out_suffix} " ) " .gb"
91
+
92
+ if [[ " ${is_windows} " == " true" ]]; then
93
+ " ${goto_cc} " \
94
+ ${export_flag} \
95
+ --verbosity 10 \
96
+ ${wall} \
97
+ ${suffix} \
98
+ /c " ${base} .c" \
99
+ /Fo" ${OUT_FILE} "
100
+
101
+ else
102
+ " ${goto_cc} " \
103
+ ${export_flag} \
104
+ --verbosity 10 \
105
+ ${wall} \
106
+ ${suffix} \
107
+ -c " ${base} .c" \
108
+ -o " ${OUT_FILE} "
109
+ fi
110
+ done
111
+ fi
90
112
91
113
if is_in final-link " $ALL_ARGS " ; then
92
114
OUT_FILE=final-link.gb
Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+
3
+ static int foo ()
4
+ {
5
+ assert (0 );
6
+ return 1 ;
7
+ }
Original file line number Diff line number Diff line change
1
+ int __CPROVER_file_local_foo_c_foo ();
2
+
3
+ int main ()
4
+ {
5
+ return __CPROVER_file_local_foo_c_foo ();
6
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ assertion-check compile-and-link
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION FAILED$
7
+ --
8
+ ^warning: ignoring
9
+ ^\*\*\*\* WARNING: no body for function
10
+ --
11
+ Check that when files are compiled together in a single invocation
12
+ of goto-cc, exported function symbols are still mangled correctly.
Original file line number Diff line number Diff line change @@ -346,6 +346,13 @@ bool compilet::link()
346
346
convert_symbols (goto_model.goto_functions );
347
347
}
348
348
349
+ if (keep_file_local)
350
+ {
351
+ function_name_manglert<file_name_manglert> mangler (
352
+ get_message_handler (), goto_model, file_local_mangle_suffix);
353
+ mangler.mangle ();
354
+ }
355
+
349
356
if (write_bin_object_file (output_file_executable, goto_model))
350
357
return true ;
351
358
You can’t perform that action at this time.
0 commit comments