summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-cov
Commit message (Collapse)AuthorAgeFilesLines
...
* [Coverage] Restore the correct count value after processing a nested region ↵Igor Kudrin2016-04-251-2/+2
| | | | | | | | | | | | | in case of combined regions. If several regions cover the same area of code, we have to restore the combined value for that area when return from a nested region. This patch achieves that by combining regions before calling buildSegments. Differential Revision: http://reviews.llvm.org/D18610 llvm-svn: 267390
* Reapply "[Coverage] Prevent detection of false instantiations in case of ↵Igor Kudrin2016-04-185-1/+52
| | | | | | | | | | | | | | | | | | macro expansion." The root of the problem was that findMainViewFileID(File, Function) could return some ID for any given file, even though that file was not the main file for that function. This patch ensures that the result of this function is conformed with the result of findMainViewFileID(Function). This commit reapplies r266436, which was reverted by r266458, with the .covmapping file serialized in v1 format. Differential Revision: http://reviews.llvm.org/D18787 llvm-svn: 266620
* Revert "[Coverage] Prevent detection of false instantiations in case of ↵Igor Kudrin2016-04-155-52/+1
| | | | | | | | macro expansion." This reverts commit r266436 as it broke buildbot. llvm-svn: 266458
* [Coverage] Prevent detection of false instantiations in case of macro expansion.Igor Kudrin2016-04-155-1/+52
| | | | | | | | | | | | | The root of the problem was that findMainViewFileID(File, Function) could return some ID for any given file, even though that file was not the main file for that function. This patch ensures that the result of this function is conformed with the result of findMainViewFileID(Function). Differential Revision: http://reviews.llvm.org/D18787 llvm-svn: 266436
* [Coverage] Fix the expected counts in instrprof-comdat.hVedant Kumar2016-03-281-6/+3
| | | | llvm-svn: 264675
* Reapply (2x) "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar2016-03-284-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | Function names in ObjC can have spaces in them. This interacts poorly with name compression, which uses spaces to separate PGO names. Fix the issue by using a different separator and update a test. I chose "\01" as the separator because 1) it's non-printable, 2) we strip it from PGO names, and 3) it's the next natural choice once "\00" is discarded (that one's overloaded). What's changed since the original commit? - I fixed up the covmap-V2 binary format tests using a linux VM. - I weakened the CHECK lines in instrprof-comdat.h to account for the fact that there have been bugfixes to clang coverage. These will be fixed up in a follow-up. - I added an assert to make sure we don't get bitten by this again. - I constructed the c-general.profraw file without name compression enabled to appease some bots. Differential Revision: http://reviews.llvm.org/D18516 llvm-svn: 264658
* Revert "Reapply "[PGO] Fix name encoding for ObjC-like functions""Vedant Kumar2016-03-284-8/+3
| | | | | | | This reverts commit r264641 to investigate why c-general.test is failing on the bots. llvm-svn: 264643
* Reapply "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar2016-03-284-3/+8
| | | | | | | | | | | | | | | | | | | | | Function names in ObjC can have spaces in them. This interacts poorly with name compression, which uses spaces to separate PGO names. Fix the issue by using a different separator and update a test. I chose "\01" as the separator because 1) it's non-printable, 2) we strip it from PGO names, and 3) it's the next natural choice once "\00" is discarded (that one's overloaded). This reverts the revert commit beaf3d18. What's changed? - I fixed up the covmap-V2 binary format tests using a linux VM. - I updated the expected counts in instrprof-comdat.h to account for the fact that there have been bugfixes to clang coverage. - I added an assert to make sure we don't get bitten by this again. Differential Revision: http://reviews.llvm.org/D18516 llvm-svn: 264641
* Fix buildbot failure (hosts without zlib)Xinliang David Li2016-02-102-0/+0
| | | | llvm-svn: 260446
* [Coverage] add covmap v2 binary format regression testXinliang David Li2016-02-104-1/+3
| | | | llvm-svn: 260428
* llvm-cov: Fix reading gcov data that does not have function namesJustin Bogner2016-02-083-0/+30
| | | | | | | | | | | | | | | | | | | | | In order for recent gcov versions to read the coverage data, you have to use UseCfgChecksum=true and FunctionNamesInData=false options for coverage profiling pass. This is because gcov is expecting the function section in .gcda to be exactly 3 words in size, containing ident and two checksums. While llvm-cov is compatible with UseCfgChecksum=true, it always expects a function name in .gcda function sections (it's not compatible with FunctionNamesInData=false). Thus it's currently impossible to generate one set of coverage files that works with both gcov and llvm-cov. This change fixes the reading of coverage information to only read the function name if it's present. Patch by Arseny Kapoulkine. Thanks! llvm-svn: 260162
* re-submit test case (withright format-version)Xinliang David Li2016-01-214-0/+29
| | | | llvm-svn: 258384
* Revert 258376 -- wrong versionXinliang David Li2016-01-214-29/+0
| | | | llvm-svn: 258377
* [Coverage] Add a test case for comdatXinliang David Li2016-01-214-0/+29
| | | | | | | | | | | The binary contains two (merged) covmap sections which have duplicate CovMapRecords from comdat (template instantation). This test makes sure the reader reads it properly. It also tests that the coverage data from different instantiations of the same template function are properly merged in show output. llvm-svn: 258376
* InstrProf: Fix display of large numbers in llvm-covJustin Bogner2015-05-134-37/+37
| | | | | | | | llvm-cov was truncating numbers that were larger than a particular fixed width, which is as confusing as it is useless. Instead, we use engineering notation with SI prefix for magnitude. llvm-svn: 237307
* llvm-cov: Require a subcommand when invoked as llvm-covJustin Bogner2015-03-243-23/+23
| | | | | | | | | | | | | | A while ago llvm-cov gained support for clang's instrumentation based profiling in addition to its gcov support, and subcommands were added to choose which behaviour to use. When no subcommand was specified, we fell back to gcov compatibility with a warning that a subcommand would be required in the future. Now, we require the subcommand. Note that if the basename of llvm-cov is gcov (via symlink or hardlink, for example), we still use the gcov compatible behaviour with no subcommand required. llvm-svn: 233132
* llvm-cov: Only emit colour by default if the output is a ttyJustin Bogner2015-03-195-11/+11
| | | | | | | This replaces the -no-color flag with a -color={auto|always|never} option, with auto as the default, which is much saner. llvm-svn: 232693
* llvm-cov: Warn instead of error if a .gcda has arcs from an exit blockJustin Bogner2015-03-173-0/+4
| | | | | | Patch by Vanderson M. Rosario. Thanks! llvm-svn: 232443
* InstrProf: Fix CoverageMappingReader on big endianJustin Bogner2015-03-162-0/+1
| | | | | | | | This makes the reader check the endianness of the object file its given and behave appropriately. For the test I dug up a really old linker and created a ppc-apple-darwin file for llvm-cov to read. llvm-svn: 232422
* InstrProf: Remove xfails for big-endian from coverage testsJustin Bogner2015-03-168-24/+0
| | | | | | | | | This still doesn't actually work correctly for big endian input files, but since these tests all use little endian input files they don't actually fail. I'll be committing a real fix for big endian soon, but I don't have proper tests for it yet. llvm-svn: 232354
* InstrProf: Do a better job of reading coverage mapping data.Justin Bogner2015-03-165-4/+15
| | | | | | | | | | | | | | | | | | | | | | This code was casting regions of a memory buffer to a couple of different structs. This is wrong in a few ways: 1. It breaks aliasing rules. 2. If the buffer isn't aligned, it hits undefined behaviour. 3. It completely ignores endianness differences. 4. The structs being defined for this aren't specifying their padding properly, so this doesn't even represent the data properly on some platforms. This commit is mostly NFC, except that it fixes reading coverage for 32 bit binaries as a side effect of getting rid of the mispadded structs. I've included a test for that. I've also baked in that we only handle little endian more explicitly, since that was true in practice already. I'll fix this to handle endianness properly in a followup commit. llvm-svn: 232346
* Now that r231902's test is executed, make it actually passJustin Bogner2015-03-112-2/+2
| | | | | | | | As of r231908, the test I added in r231902 actually gets run - but I'd checked in a stale version of the input so it didn't pass. Fix the input and un-xfail the test. llvm-svn: 231911
* Make test added in r231902 actually be executed.Daniel Jasper2015-03-112-3/+3
| | | | | | | | | There were also errors in the CHECK line which I fixed and the test doesn't actually pass as the "100" is in the wrong line. Not sure whether this is a test failure or a coverage failure so making the test XFAIL for now. llvm-svn: 231908
* InstrProf: Teach llvm-cov to handle universal binaries when given -archJustin Bogner2015-03-113-0/+17
| | | | llvm-svn: 231902
* InstrProf: Use the proftext format for these coverage testsJustin Bogner2015-03-096-3/+24
| | | | | | This format's easier to understand and update by hand. llvm-svn: 231686
* lit: Add 'cd' support to the internal shell and port some testsReid Kleckner2015-03-021-1/+2
| | | | | | | | | | | The internal shell was already threading around a 'cwd' parameter. We just have to make it mutable so that we can update it as the test script executes. If the shell ever grows support for environment variable substitution, we could also implement support for export. llvm-svn: 231017
* InstrProf: Teach llvm-cov to show the max count instead of the lastJustin Bogner2015-02-231-2/+2
| | | | | | | | | | | | When multiple regions start on the same line, llvm-cov was just showing the count of the last one as the line count. This can be confusing and misleading for things like one-liner loops, where the count at the end isn't very interesting, or even "if" statements with an opening brace at the end of the line. Instead, use the maximum of all of the region start counts. llvm-svn: 230263
* llvm-cov: Actually use the command line arguments when reportingJustin Bogner2015-02-142-3/+17
| | | | | | | | This code didn't really make sense as is. If a filename is passed in, the user obviously wants the coverage *for that file*, not *for everything*. llvm-svn: 229217
* InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't usedJustin Bogner2015-02-034-6/+6
| | | | | | | It's not entirely clear to me what this field was meant for, but it's always false. Remove it. llvm-svn: 228034
* Revert r218673 'llvm-cov: add test for report's function & file association.'Alex Lorenz2014-09-304-32/+0
| | | | | | Test causes buildbot failures. llvm-svn: 218676
* llvm-cov: add test for report's function & file association.Alex Lorenz2014-09-304-0/+32
| | | | | | | | This commit adds a test which checks that the functions defined in header files will get associated with the header files rather than the source files in the reports. Differential Revision: http://reviews.llvm.org/D5489 llvm-svn: 218673
* llvm-cov: Use the number of executed functions for the function coverage metric.Alex Lorenz2014-09-303-0/+24
| | | | | | | | This commit fixes llvm-cov's function coverage metric by using the number of executed functions instead of the number of fully covered functions. Differential Revision: http://reviews.llvm.org/D5196 llvm-svn: 218672
* llvm-cov: Combine segments that cover the same locationJustin Bogner2014-09-253-0/+43
| | | | | | | | If we have multiple coverage counts for the same segment, we need to add them up rather than arbitrarily choosing one. This fixes that and adds a test with template instantiations to exercise it. llvm-svn: 218432
* llvm-cov: Prevent a test from matching its own check linesJustin Bogner2014-09-192-5/+3
| | | | | | | Since llvm-cov shows the source file in its output, be careful about potentially matching the check lines themselves. llvm-svn: 218138
* llvm-cov: Fix dropped lines when filters were appliedJustin Bogner2014-09-192-1/+6
| | | | | | | Uncovered lines in the middle of a covered region weren't being shown when filtering to a particular function. llvm-svn: 218109
* llvm-cov: Push some more debug output into the View (NFC)Justin Bogner2014-09-171-3/+3
| | | | llvm-svn: 217984
* Exclude known and bugzilled failures from UBSan bootstrapAlexey Samsonov2014-09-171-0/+4
| | | | llvm-svn: 217979
* llvm-cov: Make debug output more consistentJustin Bogner2014-09-152-2/+2
| | | | | | | | This changes the debug output of the llvm-cov tool to consistently write to stderr, and moves the highlighting output closer to where it's relevant. llvm-svn: 217838
* llvm-cov: Fix an issue with showing regions but not countsJustin Bogner2014-09-151-1/+1
| | | | | | | | | | | In r217746, though it was supposed to be NFC, I broke llvm-cov's handling of showing regions without showing counts. This should've shown up in the existing tests, except they were checking debug output that was displayed regardless of what was actually output. I've moved the relevant debug output to a more appropriate place so that the tests catch this kind of thing. llvm-svn: 217835
* Revert "llvm-cov: Remove an overly system specific test"Justin Bogner2014-09-112-0/+31
| | | | | | | | | | This fixes a call to sys::fs::equivalent that should've been to CodeCoverageTool::equivalentFiles, which lets us restore the test of r217476 that was removed in r217478. This reverts r217478, but the test works this time. llvm-svn: 217646
* llvm-cov: Remove an overly system specific testJustin Bogner2014-09-101-31/+0
| | | | | | | | | | It appears that the -filename-equivalence option for testing llvm-cov doesn't work correctly with -show-expansions. I'm reverting this test to get the bots green while I look into fixing that. This partially reverts r217476 llvm-svn: 217478
* llvm-cov: Fix a misuse of ArrayRef::slice I introduced in r217430Justin Bogner2014-09-103-0/+31
| | | | | | | It appears this code was completely untested, so using ArrayRef wrong didn't break anything obvious. llvm-svn: 217476
* llvm-cov: test: add xfail for the big-endian buildbotsAlex Lorenz2014-08-233-0/+9
| | | | llvm-svn: 216310
* llvm-cov: add code coverage tool that's based on coverage mapping format and ↵Alex Lorenz2014-08-2210-4/+108
| | | | | | | | | | | | | clang's pgo. This commit expands llvm-cov's functionality by adding support for a new code coverage tool that uses LLVM's coverage mapping format and clang's instrumentation based profiling. The gcov compatible tool can be invoked by supplying the 'gcov' command as the first argument, or by modifying the tool's name to end with 'gcov'. Differential Revision: http://reviews.llvm.org/D4445 llvm-svn: 216300
* llvm-cov: Support specifying multiple source filesJustin Bogner2014-06-271-3/+3
| | | | | | | | | Make llvm-cov compatible with gcov for cases where multiple files are specified on the command line. That is, loop over each one and report coverage, and report errors on stderr only rather than via return code. llvm-svn: 211959
* Do not XFAIL test/tools/llvm-cov tests on powerpc64leUlrich Weigand2014-06-183-3/+3
| | | | | | | | | | | All tests in test/tools/llvm-cov fail on big-endian targets and are supposed to be XFAILed there. However, including "powerpc64" in the XFAIL line is now incorrect, since that matches both powerpc64- and powerpc64le- targets, and the tests pass on the latter. Update the XFAIL lines to use powerpc64- instead (like mips64-). llvm-svn: 211172
* [Test] Trim unnecessary .c and .cpp from config.suffix in lit.local.cfgAdam Nemet2014-05-121-1/+1
| | | | | | | | | | | | | | Tested by comparing make check VERBOSE=1 before and after to make sure no tests are missed. (VERBOSE=1 prints the list of tests.) Only one test :( remains where .cpp is required: tools/llvm-cov/range_based_for.cpp:// RUN: llvm-cov range_based_for.cpp | FileCheck %s --check-prefix=STDOUT The topic was discussed in this thread: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140428/214905.html llvm-svn: 208621
* llvm-cov: Handle missing source files as GCOV doesJustin Bogner2014-05-074-0/+97
| | | | | | | | | | | 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. llvm-svn: 208149
* llvm-cov: Implement --no-outputJustin Bogner2014-05-072-0/+9
| | | | | | | | 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. llvm-svn: 208148
* llvm-cov: Fix handling of line zero appearing in a line tableJustin Bogner2014-05-024-1/+30
| | | | | | | | | | | | | 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. llvm-svn: 207866
OpenPOWER on IntegriCloud