[klee-dev] C++ Support Status

Volodymyr Melnychenko vm at xreate.org
Sat Apr 13 09:47:42 BST 2024


Hello,

Is Klee a good tool for analyzing C++ code?  I saw an email from 2018 
regarding C++,  what's progress on it? Do you have examples of using 
Klee in C++ projects with CMake, Qt, Boost, STL, Google Test, etc?

I just started to go through examples. I set compiler and linker flags 
as follows:

add_compile_options(-flto -emit-llvm -Xclang -disable-O0-optnone)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}-flto 
-Wl,-plugin-opt=emit-llvm")


Does it look correct? I want to compile a Google Test project for a 
start consisting of only two cpp files and a few tests.


Main function is typical:

int main(int argc,char **argv) {
   testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
}

Now gtest runs and executes all tests successfully. Running Klee gives  
me this:

KLEE: WARNING: executable has module level assembly (ignoring)
KLEE: ERROR: Unable to load symbol(_ZTIN7testing4TestE) while 
initializing globals

Thanks!


-- 
Regards,
Volodymyr Melnychenko
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the klee-dev mailing list