File tree Expand file tree Collapse file tree 8 files changed +62
-2
lines changed
goto-cc-goto-analyzer/reachable-functions-export-file-local-symbols Expand file tree Collapse file tree 8 files changed +62
-2
lines changed Original file line number Diff line number Diff line change
1
+ int __CPROVER_file_local_file2_c_foo (int x );
2
+
3
+ int main ()
4
+ {
5
+ int x = __CPROVER_file_local_file2_c_foo (1 );
6
+ __CPROVER_assert (x == 2 , "x == 2" );
7
+ }
Original file line number Diff line number Diff line change
1
+ static int foo (int x )
2
+ {
3
+ return x + 1 ;
4
+ }
5
+
6
+ static int bar (int x )
7
+ {
8
+ return x + 2 ;
9
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ file1.c
3
+ final-link show-symbol-table assertion-check
4
+ ^Base name\.\.\.: __CPROVER_file_local_.*_foo$
5
+ ^EXIT=0$
6
+ ^SIGNAL=0$
7
+ --
8
+ ^warning: ignoring
9
+ ^Base name\.\.\.: foo$
10
+ --
11
+ The linking order must not affect the base name of the mangled symbol. See
12
+ base-name-2 for a test that will yield a different linking order (while still
13
+ producing the same base name).
Original file line number Diff line number Diff line change
1
+ static int foo (int x )
2
+ {
3
+ return x + 1 ;
4
+ }
5
+
6
+ static int bar (int x )
7
+ {
8
+ return x + 2 ;
9
+ }
Original file line number Diff line number Diff line change
1
+ int __CPROVER_file_local_file1_c_foo (int x );
2
+
3
+ int main ()
4
+ {
5
+ int x = __CPROVER_file_local_file1_c_foo (1 );
6
+ __CPROVER_assert (x == 2 , "x == 2" );
7
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ file1.c
3
+ final-link show-symbol-table assertion-check
4
+ ^Base name\.\.\.: __CPROVER_file_local_.*_foo$
5
+ ^EXIT=0$
6
+ ^SIGNAL=0$
7
+ --
8
+ ^warning: ignoring
9
+ ^Base name\.\.\.: foo$
10
+ --
11
+ The linking order must not affect the base name of the mangled symbol. See
12
+ base-name-1 for a test that will yield a different linking order (while still
13
+ producing the same base name).
Original file line number Diff line number Diff line change 1
1
CORE
2
2
test.c
3
3
--reachable-functions
4
- ^.* foo 1 4$
4
+ ^.* __CPROVER_file_local_project_c_foo 1 4$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
8
- ^.* [a-zA-Z0-9_]+foo \d+ \d+$
9
8
--
10
9
This test checks that after building the goto binary (see test.sh) with
11
10
--export-file-local-symbols function "foo" is still reported as reachable. Note,
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ class function_name_manglert
70
70
symbolt new_sym;
71
71
new_sym = sym;
72
72
new_sym.name = mangled;
73
+ new_sym.base_name = mangled;
74
+ if (new_sym.pretty_name .empty ())
75
+ new_sym.pretty_name = sym.base_name ;
73
76
new_sym.is_file_local = false ;
74
77
75
78
new_syms.push_back (new_sym);
You can’t perform that action at this time.
0 commit comments