Run command:
emcc -fprofile-arcs -ftest-coverage demo.cpp
Error response:
error: undefined symbol: llvm_gcda_emit_arcs (referenced by top-level compiled C/C++ code)
warning: Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _llvm_gcda_emit_arcs may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: llvm_gcda_emit_function (referenced by top-level compiled C/C++ code)
warning: _llvm_gcda_emit_function may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: llvm_gcda_end_file (referenced by top-level compiled C/C++ code)
warning: _llvm_gcda_end_file may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: llvm_gcda_start_file (referenced by top-level compiled C/C++ code)
warning: _llvm_gcda_start_file may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: llvm_gcda_summary_info (referenced by top-level compiled C/C++ code)
warning: _llvm_gcda_summary_info may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: llvm_gcov_init (referenced by top-level compiled C/C++ code)
warning: _llvm_gcov_init may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
Does anyone know how to run emcc to support code coverage?