testMemorySanitizer.cmake 1020 B

123456789101112131415161718192021222324252627
  1. # this file simulates a program that has been built with MemorySanitizer
  2. # options
  3. message("MSAN_OPTIONS = [$ENV{MSAN_OPTIONS}]")
  4. string(REGEX REPLACE ".*log_path=\'([^\']*)\'.*" "\\1" LOG_FILE "$ENV{MSAN_OPTIONS}")
  5. message("LOG_FILE=[${LOG_FILE}]")
  6. # if we are not asked to simulate address sanitizer don't do it
  7. if(NOT "$ENV{MSAN_OPTIONS}]" MATCHES "simulate_sanitizer.1")
  8. return()
  9. endif()
  10. # clear the log file
  11. file(REMOVE "${LOG_FILE}.2343")
  12. # create an error of each type of thread santizer
  13. # these names come from tsan_report.cc in llvm
  14. file(APPEND "${LOG_FILE}.2343"
  15. "=================================================================
  16. ==28423== WARNING: MemorySanitizer: use-of-uninitialized-value
  17. #0 0x7f4364210dd9 in main (/home/kitware/msan/msan-bin/umr+0x7bdd9)
  18. #1 0x7f4362d9376c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
  19. #2 0x7f4364210b0c in _start (/home/kitware/msan/msan-bin/umr+0x7bb0c)
  20. SUMMARY: MemorySanitizer: use-of-uninitialized-value ??:0 main
  21. Exiting
  22. ")