You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use mode of entry function to generate __CPROVER__start
Previously, when we compiled for instance a C file with no `main()` with goto-cc
it would have no __CPROVER__start. CBMC would use the following logic to
determine the entry point:
1. If `--function` is not passed, use existing `__CPROVER__start`
-- in our case, we don't have an existing `__CPROVER__start`, so this
doesn't work for us
2. If `--function` _is_ passed, and a `__CPROVER__start` exists: Generate a new
entry point calling the passed entry function, based on the mode of the
existing `__CPROVER__start` (I am not sure why this mode rather than the mode
of `--function`)
3. Otherwise, iterate over the non-binary input files, determine the language to
use based on The file extension for each source file, and try to generate an
appropriate `__CPROVER__start` based on that
The situation of having a single goto-binary with no `__CPROVER__start` as the
input file doesn't fit any of these cases, so regardless of whether `--function`
is passed CBMC is going to fail, complaining that it can't find or generate an
entry point. This adds a fourth case to the list:
4. If `--function` is passed and there is no `__CPROVER__start`, select the
language based on the mode of the function parameter and use it to generate
`__CPROVER__start`
This commit doesn't add tests for this change, but
diffblue#4014 adds tests that, in the absence of
this change, require hack-y workarounds (such as passing an empty file with a
`.c` extension to force C mode for case 3 in the list above) to work.
0 commit comments