Created
April 11, 2025 02:53
-
-
Save flounderK/de6bce77ea4bea357eff227542eae65b to your computer and use it in GitHub Desktop.
gather code coverage with clang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clang -fprofile-instr-generate -fcoverage-mapping -o main main.c | |
| LLVM_PROFILE_FILE="prof.profraw" ./main | |
| # merge many profraw files into a profdata | |
| llvm-profdata merge -sparse prof.profraw -o prof.profdata | |
| # show coverage | |
| llvm-cov show ./main -instr-profile=prof.profdata |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment