Commit Graph

199 Commits

Author SHA1 Message Date
Kurt Degiorgio 0b90c17a8c JBMC: Moved format_classpath.sh to scripts/format_classpath.sh
'format_classpath.sh' is used in regression tests that make use of the
'classpath' option. This script is needed to deal with the fact that
classpath syntex is OS-dependent.

The java concurrency regression tests make heavy use of this option as
such this commit moves 'format_classpath.sh' to
'scripts/format_classpath.sh'.

Furthermore, this commit makes a very small change to 'appveyor.yml'
that enables existing java concurrency regression tests to run on
Windows.
2018-06-24 15:35:02 +01:00
Michael Tautschnig 475fe2049e
Merge pull request #2393 from tautschnig/git-info-cmake-fixes
CBMC_VERSION: Use generated include files instead of command-line defines
2018-06-24 08:34:23 +01:00
Michael Tautschnig 0498da913d
Merge pull request #2400 from tautschnig/vs-return-type
Fix return type of nodes_empty
2018-06-23 23:53:06 +01:00
Michael Tautschnig 2eb9156abc
Merge pull request #2406 from tautschnig/vs-sizet1
Use std::size_t instead of int to match types at callsites
2018-06-23 23:23:16 +01:00
Michael Tautschnig e638f72c8f CBMC_VERSION: Use generated include files instead of command-line defines
Also fixes a number of shortcomings of the earlier approach as far as CMake is
concerned:
- Adds --dirty to the git command line (as is done for Makefiles).
- Does not require a rebuild when there are no changes to the version string.
- CBMC release number updates will be reflected and trigger a rebuild (even when
  no other changes have taken place).
2018-06-23 20:41:45 +00:00
Michael Tautschnig 6256290240 Fix return type of nodes_empty 2018-06-23 19:17:07 +01:00
Michael Tautschnig bd4faad628 Use std::size_t instead of int to match types at callsites 2018-06-23 19:15:00 +01:00
Michael Tautschnig 2afa919e4e Explicitly compare int to zero to avoid Visual Studio warning 2018-06-23 19:09:08 +01:00
Michael Tautschnig d7ef0bc201 Fix coreModels test to match latest java models library
As of the update in https://github.com/diffblue/java-models-library/pull/5
cprover.CProver no longer has a static initializer.
2018-06-23 15:09:12 +00:00
Thomas Kiley 8f6dab8c92
Merge pull request #2261 from thk123/bugfix/TG-3652/wrong-generic-type-two-params
Don't store generic values as comments [TG-3652]
2018-06-22 08:02:40 +01:00
Thomas Kiley 262affba78
Merge pull request #2350 from thk123/feature/TG-3813/load-specified-methods
[TG-3813] Allow specifying specific methods by regex to be loaded by lazy methods
2018-06-22 07:44:27 +01:00
Matthias Güdemann 4b124c86dc add centered git version to CBMC banner 2018-06-21 15:47:15 +00:00
Matthias Güdemann 64163725f4 windowsify compiler options 2018-06-21 15:42:21 +00:00
Michael Tautschnig 23455af549 Print git revision with all --version outputs
This uses the output of `git-describe --tags --always --dirty` to create a UID
for binaries. This includes last tag, number of commits after last tag,
shortened SHA1 checksum and optional dirty flag for uncommited changes. In case
of tagged commit, only the tag name is used.
2018-06-21 15:42:20 +00:00
Michael Tautschnig 7ca835bac3 Added CBMC_VERSION defines to CMake configuration 2018-06-21 15:42:20 +00:00
thk123 783fceaf9f Extend lazy-methods-extra-entry-point to support regex methods
This will allow for loading for example, all constructors or all methods
called getSomething.

Tests using this require minor modifications when they have specified
the descriptor as the brackets must be escaped for the regex. However,
the new code handles the case where no descriptor is provided (in which
case it will match all overloads) and the case where no java:: prefix
has been provided, leaving similar behaviour.

Correcting documentation for the extra entry points
2018-06-21 16:18:45 +01:00
thk123 1e55404248 CI lazy methods take vector of method loaders
These method loads can be used to manually load additional methods for
ci_lazy_methods
2018-06-21 14:29:28 +01:00
thk123 e1398bc314 Add tests for generic type erasure
Ensure that moving generic type information out of a comment doesn't
cause type errors.
2018-06-21 13:47:42 +01:00
thk123 1f9a5c47d6 Adding test about the type 2018-06-21 13:47:41 +01:00
thk123 bd907a4c9e Diversified the test for multiple fields
Though this wasn't the problem, makes the tests more robust as more than
one type used in specialising the same generic type.
2018-06-21 13:47:41 +01:00
thk123 e95f59d86e Don't instantiate abstract types when they are returned from stubs
This is less agressive than the original solution of not instantating
abstract types in ci_lazy_methods at all. This is done to minimize the
changes this PR introduces.
2018-06-21 11:23:13 +01:00
thk123 d7d5f63529 Disable lazy loading opaque return for symex driven loading 2018-06-21 11:23:13 +01:00
thk123 409d892d42 Don't forcibly instantiate abstract classes
If a class is abstract then there definitely isn't an instance of it so
we shouldn't load those methods.
2018-06-21 11:23:12 +01:00
thk123 a71889372e Adding test to ensure methods on return type of opaque function
These methods should be loaded for all classes where an instance might
be seen and the return of an opaque method is one such instance.
2018-06-21 11:23:12 +01:00
thk123 20645c9f3f Add classes to needed classes for parameters and returns for opaque calls
Use gather all fields when setting up the return of an opaque method

This can be considered an input to the function under test, so therefore
we need to set it up in the same way.
2018-06-21 11:23:12 +01:00
thk123 9d42bc87a0 Move method for gathering all instantiated types into ci_lazy_methods_needed 2018-06-21 11:23:12 +01:00
thk123 9981faba6f Correct doxygen documentation 2018-06-21 11:23:12 +01:00
Daniel Kroening f7cd161c6c
Merge pull request #2371 from diffblue/fix-tests2
make test independent of index type
2018-06-20 14:39:49 +01:00
Daniel Kroening 82753bc70f make test independent of index type 2018-06-20 12:46:30 +01:00
Michael Tautschnig 6cd6d31d5b Unit test framwork: use references when catching exceptions
GCC 8 warns about catching by value; this was not caught in the earlier cleanup
as it did not include unit tests.
2018-06-20 07:35:05 +01:00
Owen Jones 2df6d81d44 Set name of java array types 2018-06-18 09:41:29 +01:00
Romain Brenguier c4aadabc22 Extract handle_virtual_methods_with_no_callees 2018-06-17 18:25:36 +01:00
Romain Brenguier cac016d314 Extract a convert_and_analyze_method method 2018-06-17 18:25:36 +01:00
Romain Brenguier ca0adc95b0 Correct indentation 2018-06-17 18:25:36 +01:00
Romain Brenguier 24b6936ffe Extract entry_point_methods method 2018-06-17 18:25:36 +01:00
Peter Schrammel 360fabe54a
Merge pull request #2356 from peterschrammel/fix-goto-simplification
Fix if-then-else simplifications
2018-06-15 18:45:52 +01:00
Peter Schrammel 43940164ee Temporary fix to enable if-then-else simplifications
Partially reverts 199d4cc, which accidentially disabled
simplifications that require incomplete instructions to
be marked GOTO.
2018-06-15 22:14:07 +05:30
Peter Schrammel d433438107 Test for if-then-else optimisation in goto convert
The optimisation has been inadvertently broken by 199d4cc
due to lack of a regression test.
2018-06-15 22:06:04 +05:30
Kurt Degiorgio 7d4d4bd5d9 Skip check for unsoundness in shared pointer handling (java only)
If the 'java-threading' option is specified this commit prevents symex
from throwing an exception when it encounters pointers that are shared
across threads. This is unsound but given that pointers are ubiquitous
in java this check must be disabled (until the concurrency encoding is
fixed).
2018-06-15 16:08:31 +01:00
Peter Schrammel cd2ef4b070 Enable throwing of AssertionError
Introduces --throw-assertion-error which allows
to propgate AssertionError as performed in the JVM
rather than using a goto ASSERT statement.
2018-06-14 09:46:31 +01:00
Peter Schrammel 07acde40b4 Refactor user-defined assertion translation for Java
Assertions in Java are "throw a;" statements where
a is of type java.lang.AssertionError (an exception,
or Throwable, to be precise). Sometimes we want to
translate it into an ASSERT instruction in the goto
program. Special-casing in order to  handle that
was scattered across multiple classes. In this commit
we special-case it only once in the Java frontend
and translate it into assert(false); assume(false);
which is then correctly handled by later stages of the
translation.
2018-06-14 09:46:29 +01:00
Peter Schrammel 04c0205679 Assert that there is uncaught exception
That's the default behaviour because an escaping exception
makes the JVM abort. The user can override this behaviour
using the --disable-uncaught-exception-check option.
2018-06-14 09:46:28 +01:00
Peter Schrammel 55bdbc7160 Recompile regression test class files
The java files were changed in previous commits,
but the class files were not recompiled, which
caused confusing mismatches in line numbers.
2018-06-14 08:45:39 +01:00
Daniel Kroening 5a4dc8d8c0
Merge pull request #2315 from diffblue/fix-goto
fix half-constructed GOTO instruction
2018-06-14 08:25:08 +01:00
Daniel Kroening 199d4cc841 prevent half-constructed GOTO instructions 2018-06-14 08:24:18 +01:00
Romain Brenguier 8fac5edd2e
Merge pull request #2069 from romainbrenguier/refactor/convert_instruction
Refactor java_bytecode_convert_methodt::convert_instructions
2018-06-13 20:55:26 +01:00
Romain Brenguier 67081d5af7 Extract convert_pop function 2018-06-13 09:07:31 +01:00
Romain Brenguier cd98a1f6e3 Extract convert_switch function 2018-06-13 09:07:31 +01:00
Romain Brenguier f2acb004e2 Extract convert_dup2_x2 function 2018-06-13 09:07:31 +01:00
Romain Brenguier 66cf70991c Extract convert_dup2_x1 function 2018-06-13 09:07:31 +01:00