File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
regression/goto-harness-multi-file-project/static_symbols_referencing Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include "first_one.h"
2
+ #include <assert.h>
3
+
4
+ static int static_function (int a )
5
+ {
6
+ assert (a == 0 );
7
+ return a ;
8
+ }
9
+
10
+ int non_static_function (int a )
11
+ {
12
+ return static_function (a );
13
+ }
14
+
15
+ static int with_matching_signature (int a )
16
+ {
17
+ assert (0 && "this is not reachable as far as goto-harness is concerned" );
18
+ return 0 ;
19
+ }
20
+
21
+ void non_static_with_non_matching_signature (void )
22
+ {
23
+ // this is just here so `static_with_matching_signature` has a non-file-local use
24
+ assert (static_with_matching_signature (10 ) == 10 );
25
+ }
Original file line number Diff line number Diff line change
1
+ int non_static_function (int a );
Original file line number Diff line number Diff line change
1
+ #include "first_one.h"
2
+
3
+ int another (int (* fun_ptr )(int ), int c )
4
+ {
5
+ int a = (* fun_ptr )(c );
6
+
7
+ return a ;
8
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ dummy.c
3
+ --function another --harness-type call-function
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ \[static_function\.assertion\.1\] line \d assertion a == 0: FAILURE
7
+ \[non_static_with_non_matching_signature\.assertion\.1] line \d+ assertion static_with_matching_signature\(10\) == 10: SUCCESS
8
+
9
+ ^VERIFICATION FAILED$
10
+ --
11
+ ^CONVERSION ERROR$
12
+ --
13
+ For this particular error, we care mostly that goto-harness
14
+ doesn't reference static symbols in other files, which would
15
+ cause analysis through CBMC to fail with a conversion error.
You can’t perform that action at this time.
0 commit comments