summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-cov
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-cov] Attempt to fix a test failure on WindowsVedant Kumar2016-07-181-2/+2
| | | | | | | | | | | | | | | Don't make the test/tools/llvm-cov/demangle.test depend on the order in which symbols are seen, or on the exact formatting llvm-cov emits after a symbol is printed. This is an attempt to fix a Windows bot failure: http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9141 I don't know what the root cause of the failure is, or why the showTemplateInstantiations test doesn't fail in the same way on the Windows bots. However, this measure can't hurt, and it'll at least get me on the blamelists again. llvm-svn: 275758
* [llvm-cov] Optionally use a symbol demangler when preparing reportsVedant Kumar2016-07-151-0/+4
| | | | | | | | | | Add an option to specify a symbol demangler (as well as options to the demangler). This can be used to make reports more human-readable. This option is especially useful in -output-dir mode, since it isn't as easy to manually pipe reports into a demangler in this mode. llvm-svn: 275640
* [llvm-cov] Relax a test for WindowsVedant Kumar2016-07-151-1/+1
| | | | | | | | Attempt to address this bot failure: http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/4967 llvm-svn: 275522
* [llvm-cov] Improve error messagesVedant Kumar2016-07-151-0/+5
| | | | | | | While we're at it, extend an existing test to make sure that error messages look reasonable. llvm-svn: 275520
* [llvm-cov] Add support for creating html reportsVedant Kumar2016-07-062-0/+76
| | | | | | | | Based on a patch by Harlan Haskins! Differential Revision: http://reviews.llvm.org/D18278 llvm-svn: 274688
* [llvm-cov] Use relative paths to file reports in -output-dir modeVedant Kumar2016-06-291-0/+6
| | | | | | This makes it possible to e.g copy a report to another filesystem. llvm-svn: 274173
* [llvm-cov] Change some FileCheck prefixes to make tests reusable (NFC)Vedant Kumar2016-06-292-34/+34
| | | | | | | | I'm planning on extending these two tests with checks that validate html coverage reports. Make it easier to extend them by not using a prefix called "CHECK". llvm-svn: 274143
* [llvm-cov] Disable PGO name compression in a test fileVedant Kumar2016-06-291-0/+0
| | | | | | | | Some bots do not configure llvm with zlib enabled. Should fix: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/15571 llvm-svn: 274137
* Fix a typo; NFCVedant Kumar2016-06-291-1/+1
| | | | llvm-svn: 274136
* [llvm-cov] Do not allow ".." to escape the coverage sub-directoryVedant Kumar2016-06-293-0/+19
| | | | | | | | | | | In -output-dir mode, file reports are placed into a "coverage" directory. If filenames in the coverage mapping contain "..", they might escape out of this directory. Fix the problem by removing ".." from source filenames (expand the path component). llvm-svn: 274135
* [llvm-cov] Minor cleanups to prepare for the html format patchVedant Kumar2016-06-291-0/+7
| | | | | | | | | | | | - Add renderView{Header,Footer}, renderLineSuffix, and hasSubViews to support creating tables with nested views. - Move the 'Format' cl::opt to make it easier to extend. - Just create one function view file, instead of overwriting the same file for every new function. Add a regression test for this. llvm-svn: 274086
* [llvm-cov] Create an index of reports in -output-dir modeVedant Kumar2016-06-281-0/+4
| | | | | | | | | | This index lists the reports available in the 'coverage' sub-directory. This will help navigate coverage output from large projects. This commit factors the file creation code out of SourceCoverageView and into CoveragePrinter. llvm-svn: 274029
* [llvm-cov] Minor cleanups (NFC)Vedant Kumar2016-06-281-1/+1
| | | | | | | | - Test the '-o' alias for -output-dir. - Use a helper method in a conditional. - Add a period. llvm-svn: 274028
* Reapply "[llvm-cov] Add an -output-dir option for the show sub-command""Vedant Kumar2016-06-281-0/+6
| | | | | | | | | | | | | | | Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if it doesn't already exist, and prints reports into that directory. In function view mode, all views are written into path/to/dir/functions.$EXTENSION. In file view mode, all views are written into path/to/dir/coverage/$PATH.$EXTENSION. Changes since the initial commit: - Avoid accidentally closing stdout twice. llvm-svn: 273985
* Revert "[llvm-cov] Add an -output-dir option for the show sub-command"Vedant Kumar2016-06-281-6/+0
| | | | | | | This reverts commit r273971. test/profile/instrprof-visibility.cpp is failing because of an uncaught error in SafelyCloseFileDescriptor. llvm-svn: 273978
* [llvm-cov] Add an -output-dir option for the show sub-commandVedant Kumar2016-06-281-0/+6
| | | | | | | | | | | Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if it doesn't already exist, and prints reports into that directory. In function view mode, all views are written into path/to/dir/functions.$EXTENSION. In file view mode, all views are written into path/to/dir/coverage/$PATH.$EXTENSION. llvm-svn: 273971
* [llvm-cov] Use -check-prefixes in a test (NFC)Vedant Kumar2016-06-281-2/+2
| | | | llvm-svn: 273970
* [llvm-cov] Add a format option for the 'show' sub-command (mostly NFC)Vedant Kumar2016-06-281-1/+1
| | | | llvm-svn: 273968
* [llvm-cov] Fix two warningsVedant Kumar2016-06-241-0/+11
| | | | | | | | | They were using output streams inconsistently. One also had a grammar bug. I noticed these while trying to pare down D18278. llvm-svn: 273642
* [llvm-cov] Fix a buggy lit testVedant Kumar2016-06-221-1/+1
| | | | | | | There is no check prefix for "WHOLE-FILE": this particular line was supposed to use the "ALL" prefix. llvm-svn: 273517
* [Coverage] Fix an issue where improper coverage mapping data could be loaded ↵Igor Kudrin2016-05-204-0/+54
| | | | | | | | | | | | | | for an inline function. If an inline function is observed but unused in a translation unit, dummy coverage mapping data with zero hash is stored for this function. If such a coverage mapping section came earlier than real one, the latter was ignored. As a result, llvm-cov was unable to show coverage information for those functions. Differential Revision: http://reviews.llvm.org/D20286 llvm-svn: 270194
* [Coverage] Ensure that coverage mapping data has an expected alignment in ↵Igor Kudrin2016-05-187-0/+0
| | | | | | | | | | | | | 'covmapping' files. Coverage mapping data is organized in a sequence of blocks, each of which is expected to be aligned by 8 bytes. This feature is used when reading those blocks, see VersionedCovMapFuncRecordReader::readFunctionRecords(). If a misaligned covearge mapping data has more than one block, it causes llvm-cov to fail. Differential Revision: http://reviews.llvm.org/D20285 llvm-svn: 269887
* [Coverage] Combine counts of expansion regions if there are no code regions ↵Igor Kudrin2016-05-053-0/+34
| | | | | | | | for the same area. Differential Revision: http://reviews.llvm.org/D18831 llvm-svn: 268620
* [llvm-cov] Don't emit 'nan%' in reportsVedant Kumar2016-04-291-2/+4
| | | | llvm-svn: 267971
* [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
OpenPOWER on IntegriCloud