diffkemp icon indicating copy to clipboard operation
diffkemp copied to clipboard

Simplify unit tests which needs debug information

Open PLukas2018 opened this issue 1 year ago • 0 comments

SimpLL unit tests, which are located in the tests/unit_tests/simpll/DifferentialFunctionComparatorTest.cpp file, contain test cases that need debug info to work correctly. Specifically, the test cases that use debug info are:

  • CmpGepsRenamed,
  • CmpAllocs,
  • CmpMemsets,
  • CmpValuesMacroConstantMap,
  • GetCSourceIdentifierType.

The preparation of the debug info is not much user friendly and can be complicated, e.g. the CmpMemsets test case looks like this: https://github.com/diffkemp/diffkemp/blob/eb7511df05bd27347df3eac27eca7e6cc83713a1/tests/unit_tests/simpll/DifferentialFunctionComparatorTest.cpp#L680-L799

Currently, there are not many test cases that use the debug info, but it could be useful to simplify this e.g. by writing the tests in LLVM IR (similarly as is done in tests/unit_tests/simpll/DFCLlvmIrTest.cpp). The problem is that writing debug info in LLVM IR is not user-friendly at all. A possible solution could be to write the code in C and compile it to LLVM IR (so the debug info is created by the compiler), but with this, we will lose precision over the LLVM IR code. So the way of the simplification needs to be thought up. (This issue was created to record something that we were talking about.)

PLukas2018 avatar Jul 18 '24 16:07 PLukas2018