about summary refs log tree commit diff homepage
path: root/test
AgeCommit message (Collapse)Author
2017-07-19Implement basic support for vectorized instructions.Dan Liew
We use LLVM's Scalarizer pass to remove most vectorized code so that the Executor only needs to support the InsertElement and ExtractElement instructions. This pass was not available in LLVM 3.4 so to support that LLVM version the pass has been back ported. To check that the Executor is not receiving vector operand types that it can't handle assertions have been added. There are a few limitations to this implementation. * The InsertElement and ExtractElement index cannot be symbolic. * There is no support for LLVM < 3.4.
2017-06-08Merge pull request #667 from andreamattavelli/fix_macos_varargCristian Cadar
Removing flaky test Vararg.c from Darwin build until we find a proper…
2017-06-07Prevent test failure when realloc fails in test/Feature/Realloc.cAndrew Santosa
2017-06-05Removing flaky test Vararg.c from Darwin build until we find a proper fixAndrea Mattavelli
2017-06-05Fix test failure on systems with libstdc++ corresponding to gcc7.Dan Liew
This fixes #664. As reported by @jirislaby the `test/Feature/LongDouble.cpp` test fails to compile with Clang 3.4 due to new changes the libstdc++ headers. This ends up giving errors like ``` In file included from /home/abuild/rpmbuild/BUILD/klee-1.3.0+20170409/test/Feature/LongDouble.cpp:12: In file included from /usr/bin/../lib64/gcc/x86_64-suse-linux/7/../../../../include/c++/7/cstdlib:77: /usr/bin/../lib64/gcc/x86_64-suse-linux/7/../../../../include/c++/7/bits/std_abs.h:101:3: error: unknown type name '__float128' __float128 ^ /usr/bin/../lib64/gcc/x86_64-suse-linux/7/../../../../include/c++/7/bits/std_abs.h:102:7: error: unknown type name '__float128' abs(__float128 __x) ^ 2 errors generated. ``` Clang 4.0 seems fine with this source file so the problem has already been addressed upstream so we don't need to file a bug. We just need to move to a newer LLVM version to fix this properly! To work around this the test has been made into a C program rather than a C++ program to avoid including the C++ headers. The program wasn't using any important C++ features anyway so this seems like a sensible change.
2017-05-24travis CI: add LLVM 3.5 and 3.6 testsJiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-04-08[CMake] Don't redownload FileCheck.cpp if it existsemlai
2017-04-06[NFC] Reindent `test/lit.cfg` and add vim mode line to use rightDan Liew
indentation and syntax highlighting.
2017-04-06test: lit, add geq/lt-llvm- configsJiri Slaby
This is useful for testing ranges. Especially when tests are run on later LLVM versions. This code is funny as it uses 2, 3, and 4 spaces for indentation :). This is extensively used in #605. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-03-23Add test case to check that on early exits stats are flushedDan Liew
2017-03-23Merge pull request #619 from jirislaby/FD_FailCristian Cadar
test: POSIX, stop FD_Fail to fail
2017-03-17test: POSIX, stop FD_Fail to failJiri Slaby
In our build environments, /etc/fstab is an empty file. Use /etc/mtab, which should be non-empty anywhere, hopefully. For the reference, the test fails as follows: FAIL: KLEE :: Runtime/POSIX/FD_Fail.c (188 of 212) ************ TEST 'KLEE :: Runtime/POSIX/FD_Fail.c' FAILED ************ Script: -- clang-3.8 -Iinclude test/Runtime/POSIX/FD_Fail.c -emit-llvm -O0 -c -o build/test/Runtime/POSIX/Output/FD_Fail.c.tmp1.bc rm -rf build/test/Runtime/POSIX/Output/FD_Fail.c.tmp.klee-out build/bin/klee --output-dir=build/test/Runtime/POSIX/Output/FD_Fail.c.tmp.klee-out --libc=uclibc --posix-runtime build/test/Runtime/POSIX/Output/FD_Fail.c.tmp1.bc --sym-files 0 0 --max-fail 1 > build/test/Runtime/POSIX/Output/FD_Fail.c.tmp.log grep -q "fread(): ok" build/test/Runtime/POSIX/Output/FD_Fail.c.tmp.log grep -q "fread(): fail" build/test/Runtime/POSIX/Output/FD_Fail.c.tmp.log grep -q "fclose(): ok" build/test/Runtime/POSIX/Output/FD_Fail.c.tmp.log grep -q "fclose(): fail" build/test/Runtime/POSIX/Output/FD_Fail.c.tmp.log -- Exit Code: 1 Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-03-17test: fix 'not' buildJiri Slaby
There was a typo and 'not' utility was tried to be built with FileCheck's libraries. But those can be undefined. Fix this by using the correct variable. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-03-15Fix test case for OSX: only weak aliases are supported on darwinAndrea Mattavelli
Rewritten tests by replacing 'XFAIL: darwin' with 'REQUIRES: not-darwin'
2017-03-15[Lit] Add system information (linux/darwim) to LIT configuration. Added ↵Dan Liew
'not-*' features that exist if target operating system does not match a list of know operating systems.
2017-03-07Merge pull request #608 from jirislaby/kill_testAndrea Mattavelli
test: ConstantExpr, kill bogus test
2017-03-06test: ConstantExpr, fix bogus testJiri Slaby
There is a test that thinks this should hold: ((&gInt >> 8) << 8) != ((&gInt << 8) >> 8) For example, if the address is 0x00123400, this means: 0x00123400 != 0x00123400 which is obviously not true. Kill the bogus assumption as it causes occasional failures in the tests. This is done by ORing the address with 1 so that we can have: 0x00123400 != 0x00123401 Convert also the respective truncated 32bit pointers to 64bit. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-03-06test: POSIX/DirSeek, cleanupJiri Slaby
* remove unused stat variable * use %ld for long int Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-03-06Merge pull request #609 from ccadar/warningsAndrea Mattavelli
Added new option --warnings-only-to-file which causes warnings to be written to warnings.txt only.
2017-03-01fix for PathOS.idgladtbx
2017-03-01Updated test cases that check warning messages.Cristian Cadar
2017-02-24Teach KLEE to respect the requested memory alignment of globals and stackDan Liew
variables when possible. Previously an alignment 8 was always used which did not faithfully emulate what was either explicitly requested in the LLVM IR or what the default alignment was for the target.
2017-02-21Add test case that causes an assertion failure in ↵Dan Liew
`klee::getDirectCallTarget(llvm::CallSite)`. The problem is that it doesn't handle bitcasted functions that call a weak alias.
2017-02-14Fix linker compatibility under macOSAndrea Mattavelli
2017-02-14Merge pull request #574 from delcypher/read_expr_missed_constaint_foldAndrea Mattavelli
ReadExpr::create() was missing an opportunity to constant fold
2017-02-14ReadExpr::create() was missing an opportunity to constant fold when handling ↵Dan Liew
constant arrays.
2017-02-13Merge pull request #506 from delcypher/travis_asan_ubsanCristian Cadar
Modify scripts and a test to allow ASan/UBSan builds.
2017-02-10test: fix broken Vararg testMartijn Thé
The helper function had int return type, while no value was being returned. Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2017-01-19Teach both build systems to pass the user provided CXXFLAGS and CFLAGSDan Liew
when using the native compiler in system tests. This fixes the `libkleeruntest` tests when building with ASan.
2017-01-16Remove undocumented and unused `check-local`, `check-dg` and `check-lit`Dan Liew
targets from Autoconf/Makefile build system. Having these around just confuses things.
2017-01-16Rename old build system targets so thatDan Liew
* lit tests are run by the `systemtests` target * The `check` target runs the `systemtests` and `unittests` target This make its target names consistent with the CMake build system.
2017-01-16[CMake] Rename "integrationtests" to "systemtests".Dan Liew
This was a proposal from #500. @andreamattavelli pointed out that the lit tests are really system tests rather than integration tests so this commit fixes the inappropriate naming that I chose.
2017-01-14Change how error handling is done in libkleeRuntest.Dan Liew
Previously error messages would be emitted but execution would continue which might not be desirable. Now a wrapper function (for fprintf) `report_internal_error()` is used which will cause the program to exit. The older behaviour of continuing to execute after an error can be achieved by setting a new environment variable `KLEE_RUN_TEST_ERRORS_NON_FATAL`. This commit also adds a test for each error case.
2017-01-14Fix bug reported privately by @danielschemmel .Dan Liew
If KLEE generates ktest files with `--posix-runtime` then if replaying using libkleeRuntest then replay would be incorrect because the `model_version` object would be unintentionally used during replay. For now just skip over that object and try the next one. Also emit a warning if the object names don't match.
2017-01-14Write tests to test `libkleeRuntest`. The `replay_posix_runtime.c`Dan Liew
test is marked XFAIL because there is a bug in the implementation of `libkleeRuntest`. Quite a few changes had to be made to the lit configuration in order to support these tests. To run the tests I had to fix #480 for the autoconf/Makefile build system otherwise the `libkleeRuntest` library would not be found by the system linker at runtime.
2017-01-08tests: Added substitution for llvm-arAdrian Herrera
Brings llvm-ar into line with llvm-as and lli, removing the assumption that llvm-ar is installed system wide
2016-11-23Renamed .pc to .kquery (kleaver query)Eric Rizzi
2016-11-09Fix BFS searcherMartin Nowack
For performance reasons, if KLEE branches, one state is reused and it is progressed by adding new constraints. Make sure both new states end up at the end of the BFS searcher queue.
2016-11-07Implement a CMake based build system for KLEE.Dan Liew
This is based off intial work by @jirislaby in #481. However it has been substantially modified. Notably it includes a separate build sytem to build the runtimes which is inspired by the old build system. The reason for doing this is because CMake is not well suited for building the runtime: * CMake is configured to use the host compiler, not the bitcode compiler. These are not the same thing. * Building the runtime using `add_custom_command()` is flawed because we can't automatically get transitive depencies (i.e. header file dependencies) unless the CMake generator is makefiles. (See `IMPLICIT_DEPENDS` of `add_custom_command()` in CMake). So for now we have a very simple build system for building the runtimes. In the future we can replace this with something more sophisticated if we need it. Support for all features of the old build system are implemented apart from recording the git revision and showing it in the output of `klee --help`. Another notable change is the CMake build system works much better with LLVM installs which don't ship with testing tools. The build system will download the sources for `FileCheck` and `not` tools if the corresponding binaries aren't available and will build them. However `lit` (availabe via `pip install lit`) and GTest must already be installed. Apart from better support for testing a significant advantage of the new CMake build system compared to the existing "Autoconf/Makefile" build system is that it is **not** coupled to LLVM's build system (unlike the existing build system). This means that LLVM's autoconf/Makefiles don't need to be installed somewhere on the system. Currently all tests pass. Support has been implemented in TravisCI and the Dockerfile for building with CMake. The existing "Autoconf/Makefile" build system has been left intact and so both build systems can coexist for a short while. We should remove the old build system as soon as possible though because it creates an unnecessary maintance burden.
2016-09-20Merge pull request #443 from MartinNowack/feat_assembler_raisingCristian Cadar
Extended support for assembler raising
2016-09-16Avoid internalization of non-standard entry point (i.e. not the main ↵Andrea Mattavelli
function) (#455)
2016-09-15Check the existence of the entry point during the initialization of the ↵Andrea Mattavelli
POSIX runtime. If the check fails, exit with an error. (#457)
2016-08-10Extended support for assembler raisingMartin Nowack
Improved support for assembler handling. Providing additional triple information to raise assembler for supported architectures only. Implemented support for raising full assembly memory fence. Added initial support for memory fences in Executor.
2016-08-08Merge pull request #447 from hutoTUM/fix-klee_get_obj_sizeMartinNowack
Fix for klee_get_obj_size() crashing on 64-bit, resolves #446
2016-08-08Fix for klee_get_obj_size() crashing on 64-bit, resolves #446hutoTUM
2016-08-04klee: add exit-on-error-type parameterJiri Slaby
It allows stopping the execution on some conditions like assertions. The use is like: klee -exit-on-error-type=Assert -exit-on-error-type=External file.llvm This is especially useful in the SV-COMP. A test to cover the new parameter was added too. Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2016-07-31Merge pull request #422 from ccadar/div-zero-testCristian Cadar
Added test case exposing division by zero failure reported by @kren1 and made division total in STP to fix it.
2016-07-11Executor: do not crash on non-sized globalsJiri Slaby
Sometimes, globals are not sized and ->getTypeStoreSize on such type crashes inside the LLVM. Check whether type is sized prior to calling the function above. A minimalistic example of Y being unsized with no effect on the actual code is put to tests. [v2] Use klee_warning for printing. And use %.*s formatting string given StringRef.data() need not be null terminated. Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2016-07-09Fix variable shifting behavior with different sizesMartin Nowack
Generated STP equality expressions have to be the same type. If a shift with different types as operands was used, therefore equality expressions of different width were generated. Beside avoiding the different sizes, this patch restores the original behavior to extract just the part involved in shifting and therefore should generate smaller expressions. Enable sdiv test case
2016-07-08Generate forked states for switch instructions deterministicallyMartin Nowack
This patch generates the states based on the order of switch-cases. Before, switch-constraints were randomly assigned to forked states. As generated code might be different between LLVM versions, we use the case values, order them, and iterate in that order over the cases. This way we can also support deterministic execution of older LLVM versions.