summaryrefslogtreecommitdiff
path: root/test/tools/llvm-cov/Inputs
Commit message (Collapse)AuthorAge
* llvm-cov: Handle missing source files as GCOV doesJustin Bogner2014-05-07
| | | | | | | | | | | If the source files referenced by a gcno file are missing, gcov outputs a coverage file where every line is simply /*EOF*/. This also occurs for lines in the coverage that are past the end of a file that is found. This change mimics gcov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208149 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement --no-outputJustin Bogner2014-05-07
| | | | | | | | In gcov, there's a -n/--no-output option, which disables the writing of any .gcov files, so that it emits only the summary info on stdout. This implements the same behaviour in llvm-cov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208148 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Fix handling of line zero appearing in a line tableJustin Bogner2014-05-02
| | | | | | | | | | | | | Reading line tables in llvm-cov was pretty broken, but would happen to work as long as no line in the table was 0. It's not clear to me whether a line of zero *should* show up in these tables, but deciding to read a string in the middle of the line table is certainly the wrong thing to do if it does. I've also added some comments, as trying to figure out what this block of code was doing was fairly unpleasant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207866 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Add support for gcov's --long-file-names optionJustin Bogner2014-04-23
| | | | | | | | GCOV provides an option to prepend output file names with the source file name, to disambiguate between covered data that's included from multiple sources. Add a flag to llvm-cov that does the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207035 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Handle functions with no line numberJustin Bogner2014-03-26
| | | | | | | | | Functions may in an instrumented binary but not in the original source when they're inserted by the compiler or the runtime. These functions aren't meaningful to the user, so teach llvm-cov to skip over them instead of crashing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204863 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement the preserve-paths flagJustin Bogner2014-02-04
| | | | | | | | | | | | | | | | Until now, when a path in a gcno file included a directory, we would emit our .gcov file in that directory, whereas gcov always emits the file in the current directory. In doing so, this implements gcov's strange name-mangling -p flag, which is needed to avoid clobbering files when two with the same name exist in different directories. The path mangling is a bit ugly and only handles unix-like paths, but it's simple, and it doesn't make any guesses as to how it should behave outside of what gcov documents. If we decide this should be cross platform later, we can consider the compatibility implications then. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200754 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement the object-directory flagJustin Bogner2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200741 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Ignore missing .gcda filesJustin Bogner2014-02-04
| | | | | | | | When gcov is run without gcda data, it acts as if the counts are all zero and labels the file as - to indicate that there was no data. We should do the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200740 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added -f option for function summaries.Yuchen Wu2013-12-19
| | | | | | | | | | | Similar to the file summaries, the function summaries output line, branching and call statistics. The file summaries have been moved outside the initial loop so that all of the function summaries can be outputted before file summaries. Also updated test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197633 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Print coverage summary to STDOUT.Yuchen Wu2013-12-18
| | | | | | | | | | | | File summaries will now be optionally outputted which will give line, branching and call coverage info. Unfortunately, clang's current instrumentation does not give enough information to deduce function calls, something that gcc is able to do. Thus, no calls are always outputted to be consistent with gcov output. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197606 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added -c option for branch counts.Yuchen Wu2013-12-18
| | | | | | | | | This will cause llvm-cov to output branch counts instead of branch probabilities. -b must be enabled. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197594 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added -u option for unconditional branch info.Yuchen Wu2013-12-16
| | | | | | | | | Outputs branch information for unconditional branches in addition to conditional branches. -b option must be enabled. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197432 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added -b option for branch probabilities.Yuchen Wu2013-12-13
| | | | | | | | | | | This option tells llvm-cov to print out branch probabilities when a basic block contains multiple branches. It also prints out some function summary info including the number of times the function enters, the percent of time it returns, and how many blocks were executed. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197198 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added -a option for block data.Yuchen Wu2013-12-10
| | | | | | | | | | | | | | | Similar to gcov, llvm-cov will now print out the block count at the end of each block. Multiple blocks can end on the same line. One computational difference is by using -a, llvm-cov will no longer simply add the block counts together to form a line count. Instead, it will take the maximum of the block counts on that line. This has a similar effect to what gcov does, but generates more correct counts in certain scenarios. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196856 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added test.h header to tests.Yuchen Wu2013-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196632 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Regenerated gcov files with r195513 changes.Yuchen Wu2013-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196609 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Changed extension from .llcov to .gcov.Yuchen Wu2013-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196530 91177308-0d34-0410-b5e6-96231b3b80d8
* Un-revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-04
| | | | | | And add the proper fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196367 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r196358: "llvm-cov: Added support for function checksums."Daniel Jasper2013-12-04
| | | | | | | This currently breaks clang/test/CodeGen/code-coverage.c. The root cause is that the newly introduced access to Funcs[j] is out of bounds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196365 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added support for function checksums.Yuchen Wu2013-12-04
| | | | | | | The function checksums are hashed from the concatenation of the function name and line number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196358 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added file checksum to gcno and gcda files.Yuchen Wu2013-11-20
| | | | | | | | | | | | Instead of permanently outputting "MVLL" as the file checksum, clang will create gcno and gcda checksums by hashing the destination block numbers of every arc. This allows for llvm-cov to check if the two gcov files are synchronized. Regenerated the test files so they contain the checksum. Also added negative test to ensure error when the checksums don't match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195191 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Removed StringMap holding GCOVLines.Yuchen Wu2013-11-14
| | | | | | | | | | | | | | | | | According to the hazy gcov documentation, it appeared to be technically possible for lines within a block to belong to different source files. However, upon further investigation, gcov does not actually support multiple source files for a single block. This change removes a level of separation between blocks and lines by replacing the StringMap of GCOVLines with a SmallVector of ints representing line numbers. This also means that the GCOVLines class is no longer needed. This paves the way for supporting the "-a" option, which will output block information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194637 91177308-0d34-0410-b5e6-96231b3b80d8
* Added basic unit test for llvm-cov.Yuchen Wu2013-11-13
| | | | | | | | | | This test compares the output of llvm-cov against a coverage file generated by gcov. Currently, llvm-cov does not work on certain platforms (namely big-endian architectures such as PowerPC, among others). These platforms are marked as XFAIL for now, but will be fixed later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194616 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Added basic unit test for llvm-cov."Yuchen Wu2013-11-12
| | | | | | | | | | | This reverts commit r194451. Not sure why the tests are failing on the buildbot. They run fine on my local machine. Could it possibly be because of the endianness of the architectures? The GCNO and GCDA files are little-endian encoded, and llvm-cov expects it to remain that way. Is this a safe assumption? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194454 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added call to update run/program counts.Yuchen Wu2013-11-12
| | | | | | Also updated test files that were generated from this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194453 91177308-0d34-0410-b5e6-96231b3b80d8
* Added basic unit test for llvm-cov.Yuchen Wu2013-11-12
| | | | | | | | | This test compares the output of llvm-cov against a coverage file generated by gcov. Since the source file must be in the current directory when reading GCNO files, the test will first cd into the Inputs directory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194451 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Added basic unit test for llvm-cov."Yuchen Wu2013-11-05
| | | | | | This reverts commit 9cacd131c22b888303cb88e9a3235b2d7b2f19a1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194039 91177308-0d34-0410-b5e6-96231b3b80d8
* Added basic unit test for llvm-cov.Yuchen Wu2013-11-05
This test compares the output of llvm-cov against a coverage file generated by gcov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194038 91177308-0d34-0410-b5e6-96231b3b80d8