Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage with LLVM backend #286

Open
Paebbels opened this issue Feb 17, 2017 · 3 comments
Open

Code coverage with LLVM backend #286

Paebbels opened this issue Feb 17, 2017 · 3 comments
Labels
Backend: LLVM GHDL using Low-Level Virtual Machine for code generation Enhancement Feature: Coverage

Comments

@Paebbels
Copy link
Member

According to some webpages, LLVM can collect gcov compatible coverage information by enabling the same or similar compiler switches as used for GCC. I'm not sure if this applies to LLVM or only to CLang.

Is it possible to get code coverage for the LLVM backend by just passing a few parameters?

@Paebbels Paebbels added Backend: LLVM GHDL using Low-Level Virtual Machine for code generation Enhancement labels Feb 17, 2017
@tgingold
Copy link
Member

Extra instructions should be generated. Cf: https://wiki.dlang.org/LDC_LLVM_profiling_instrumentation

So, the answer is no: not possible to get coverage with just a few parameters.

@Brian-Drummond
Copy link
Contributor

If anyone is looking at this, a couple of comments:
The GCC/gcov route works well for code coverage (I use lcov/genhtml for HTML report generation) and it would be great to see the same with LLVM.

However while it implements branch coverage, the result is not as useful. In addition to branches generated by "if", "case" etc, there are a huge number of un-architected branches. For example, any signal assignment involves several branches (such as, do we schedule processes sensitive to this signal?) which are of no interest in coverage reports.

It would be useful to be able to colour branches as "track/don't track" for code coverage purposes, and for GHDL to distinguish between explicit branches in VHDL code and what I'm calling unarchitected branches. (I believe a similar problem applies to branch coverage and C++ exception mechanisms, so this doesn't just affect the VHDL community)

I should probably submit this as an enhancement request, but mentioning it here is better than nothing. If anyone feels like running with it, please do so.

@tgingold
Copy link
Member

tgingold commented Apr 15, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend: LLVM GHDL using Low-Level Virtual Machine for code generation Enhancement Feature: Coverage
Projects
None yet
Development

No branches or pull requests

4 participants