summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/profile
Commit message (Collapse)AuthorAgeFilesLines
...
* [profile] Fix tests in compiler-rt for patch in gcov ↵Calixte Denizet2018-09-203-5/+3
| | | | | | | | | | | | | | | | (https://reviews.llvm.org/D49659) Summary: Some tests are broken if patch in D49659 is accepted so this patch fixes them. Reviewers: marco-c Reviewed By: marco-c Subscribers: dberris, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49721 llvm-svn: 342661
* [gcov] Fix branch counters with switch statements (fix PR38821)Vedant Kumar2018-09-112-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Right now, the counters are added in regards of the number of successors for a given BasicBlock: it's good when we've only 1 or 2 successors (at least with BranchInstr). But in the case of a switch statement, the BasicBlock after switch has several predecessors and we need know from which BB we're coming from. So the idea is to revert what we're doing: add a PHINode in each block which will select the counter according to the incoming BB. They're several pros for doing that: - we fix the "switch" bug - we remove the function call to "__llvm_gcov_indirect_counter_increment" and the lookup table stuff - we replace by PHINodes, so the optimizer will probably makes a better job. Patch by calixte! Differential Revision: https://reviews.llvm.org/D51619 llvm-svn: 341977
* [Coverage] Ignore 'unused' functions with non-zero execution countsVedant Kumar2018-08-071-0/+53
| | | | | | | | | | | | | | | | | Frontends emit 'unused' coverage mapping records for functions which are provably unused in a TU. These unused records contain a single counter with CounterKind::Zero. However, a function may be unused in one TU and used in another. When this happens, prefer the records with a full set of counters instead of arbitrarily picking the first loaded record. There is no impact on the single-TU case. In the multiple-TU case, this resolves issues causing a function to appear unused when it's not. Testing: check-{llvm,clang,compiler-rt} rdar://42981322 llvm-svn: 339194
* [gcov] Add test which uses forkMarco Castelluccio2018-08-013-0/+50
| | | | | | Test for https://bugs.llvm.org/show_bug.cgi?id=38180. llvm-svn: 338500
* [compiler-rt] Add a routine to specify the mode used when creating profile dirs.Matt Davis2018-07-311-0/+48
| | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces `llvm_profile_set_dir_mode` and `llvm_profile_get_dir_mode` to the compiler-rt profile API. Originally, profile data was placed into a directory that was created with a hard-coded mode value of 0755 (for non-win32 builds). In certain cases, it can be helpful to create directories with a different mode other than 0755. This patch introduces set/get routines to allow users to specify a desired mode. The default remains at 0755. Reviewers: void, probinson Reviewed By: probinson Subscribers: probinson, dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D49953 llvm-svn: 338456
* [gcov] Add tests using switch, one with break clauses and one with fallthroughMarco Castelluccio2018-07-315-0/+98
| | | | llvm-svn: 338453
* [profile] Fix typo in testTeresa Johnson2018-07-191-1/+1
| | | | | | Noticed that this was causing a compiler warning in the test. llvm-svn: 337493
* [profile] Add interface to get profile filenameTeresa Johnson2018-07-191-0/+39
| | | | | | | | | | | | | | | | Summary: Add __llvm_profile_get_filename interface to get the profile filename, which can be used for identifying which profile file belongs to an app when multiple binaries are instrumented and dumping profiles into the same directory. The filename includes the path. Reviewers: davidxl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49529 llvm-svn: 337482
* [gcov] Add a test showing differences in line counts when building with or ↵Marco Castelluccio2018-07-163-0/+48
| | | | | | | | without exceptions enabled. Test for https://bugs.llvm.org/show_bug.cgi?id=38066. llvm-svn: 337174
* Add a test with __gcov_flush called before terminating the program.Marco Castelluccio2018-07-163-0/+43
| | | | | | Test for https://bugs.llvm.org/show_bug.cgi?id=38067. llvm-svn: 337150
* Add a test with multiple BBs on the same lineMarco Castelluccio2018-07-133-0/+67
| | | | | | Test for https://bugs.llvm.org/show_bug.cgi?id=38065. llvm-svn: 336996
* Simplify instrprof-dlopen-dlclose-gcov.test to avoid failures on Aarch64.Marco Castelluccio2018-07-126-6/+6
| | | | | | The test for a function with an if block in a single line (https://bugs.llvm.org/show_bug.cgi?id=38065) will be moved to a separate test. llvm-svn: 336942
* [FileCheck] Add -allow-deprecated-dag-overlap to failing compiler-rt testsJoel E. Denny2018-07-111-2/+2
| | | | | | | | | | See https://reviews.llvm.org/D47106 for details. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D47326 llvm-svn: 336845
* Remove ppc64 BE XFAILs now that gcov profiling works, after starting a cleanZaara Syeda2018-07-113-8/+2
| | | | | | build this time. llvm-svn: 336839
* Link to the correct bug number about the Mac failure for ↵Marco Castelluccio2018-07-111-1/+1
| | | | | | instrprof-shared-gcov-flush.test. llvm-svn: 336820
* Revert 336811, there are still some problems with the tests.Zaara Syeda2018-07-113-2/+8
| | | | llvm-svn: 336819
* Remove ppc64 BE XFAILs now that gcov profiling works.Zaara Syeda2018-07-113-8/+2
| | | | llvm-svn: 336811
* Remove s390x XFAILs now that gcov profiling works.Ulrich Weigand2018-07-103-6/+6
| | | | llvm-svn: 336695
* Reapply "Make __gcov_flush flush counters for all shared libraries"Marco Castelluccio2018-07-1019-16/+607
| | | | | | | This reapplies r336365, after marking tests as failing on various configurations. llvm-svn: 336678
* Revert "Make __gcov_flush flush counters for all shared libraries"Michael Zolotukhin2018-07-0719-598/+16
| | | | | | | This reverts r336365: the added tests are failing on various configurations (e.g. on green-dragon). llvm-svn: 336474
* Make __gcov_flush flush counters for all shared librariesMarco Castelluccio2018-07-0519-16/+598
| | | | | | | | | | | | | | | | | Summary: This will make the behavior of __gcov_flush match the GCC behavior. I would like to rename __gcov_flush to __llvm_gcov_flush (in case of programs linking to libraries built with different compilers), but I guess we can't for compatibility reasons. Reviewers: davidxl Reviewed By: davidxl Subscribers: samsonov, vitalybuka, pcc, kcc, junbuml, glider, fhahn, eugenis, dvyukov, davidxl, srhines, chh, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48538 llvm-svn: 336365
* [profile] Add llvm_gcov_flush to be called outside a shared libraryChih-Hung Hsieh2018-06-291-0/+30
| | | | | | | | | | __gcov_flush is hidden. For applications to dump profiling data of selected .so files, they can use dlsym to find and call llvm_gcov_flush in each .so file. Differential Revision: https://reviews.llvm.org/D45454 llvm-svn: 336019
* [Darwin] Add an integration test for PGO + symbol exportsVedant Kumar2018-06-281-0/+11
| | | | | | rdar://41470205 llvm-svn: 335891
* [profile] Move newly added test to the supported platformRong Xu2018-04-021-0/+0
| | | | | | Move test/profile/instrprof-value-merge.c from r328987 to Linux directory. llvm-svn: 329016
* [profile] Fix value profile runtime merging issuesRong Xu2018-04-021-0/+79
| | | | | | | | | | | | | | | | This patch fixes the following issues: (1) The strong definition of the merge hook function was not working which breaks the online value profile merging. This patch removes the weak attribute of VPMergeHook and assigns the value dynamically. (2) Truncate the proifle file so that we don't have garbage data at the end of the file. (3) Add new __llvm_profile_instrument_target_value() interface to do the value profile update in batch. This is needed as the original incremental by 1 in __llvm_profile_instrument_target() is too slow for online merge. Differential Revision: https://reviews.llvm.org/D44847 llvm-svn: 328987
* [profile] Test the exported symbol set for empty programsVedant Kumar2018-02-281-2/+14
| | | | | | | | Programs without any code in them should export the exact same set of symbols as programs with code, at least on Darwin. This is done to make text-based API verification possible for certain Darwin frameworks. llvm-svn: 326351
* Update test counter_promo_nest.c to meet llvm changeSerguei Katkov2018-02-081-0/+3
| | | | | | | | | | | | | | | | | The test expects to see the pattern "load add store" twice in a row. However the test contains actually several instances of this pattern. Currently the first pattern appears in the output twice. But after LLVM change https://reviews.llvm.org/D42691 some addtional modification is done and one of another pattern has been hoisted in function entry block. As a result we have another order of meeting this pattern. The test is updated to meet this change. llvm-svn: 324571
* Add space inside the regular expression.Rafael Espindola2018-02-081-1/+1
| | | | | | This should now pass on both ppc and x86. Sorry about the noise. llvm-svn: 324556
* Remove extra space.Rafael Espindola2018-02-081-1/+1
| | | | | | Should fix the ppc bots. llvm-svn: 324548
* Update for llvm change.Rafael Espindola2018-02-071-1/+1
| | | | llvm-svn: 324541
* Hide some symbols to avoid a crash on shutdown when using code coverageMarco Castelluccio2018-01-032-0/+32
| | | | | | | | | | | | | | | | | | | Summary: gcov / gcda-based profiling crashes when shared libraries are unloaded Patch by Benoit Belley and test by Marco Castelluccio for Firefox See https://bugs.llvm.org/show_bug.cgi?id=27224 & https://bugzilla.mozilla.org/show_bug.cgi?id=1401230 Reviewers: davidxl, rnk, void Subscribers: jessicah, marco-c, belleyb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38124 llvm-svn: 321703
* [PGO] Test case changes for D41059Xinliang David Li2017-12-183-6/+42
| | | | | | Differential Revision: http://reviews.llvm.org/D41059 llvm-svn: 320999
* [profile] Port the runtime to Solaris (retry)Vedant Kumar2017-12-141-1/+1
| | | | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Hopefully the Windows support is fixed now. Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320731
* Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the ↵Vedant Kumar2017-12-141-1/+1
| | | | | | | | | | | runtime to Solaris" This reverts commit r320726. It looks like flock isn't available on Windows: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio llvm-svn: 320728
* [profile] Port the runtime to SolarisVedant Kumar2017-12-141-1/+1
| | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320726
* Update test case for r320180Xinliang David Li2017-12-081-2/+2
| | | | llvm-svn: 320181
* Test case update for D40873Xinliang David Li2017-12-071-2/+2
| | | | llvm-svn: 320105
* Revert test case change for r319794Xinliang David Li2017-12-051-2/+2
| | | | llvm-svn: 319842
* [PGO] fix test case for D40702Xinliang David Li2017-12-051-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D40702 llvm-svn: 319795
* [ubsan] Re-commit: lit changes for lld testing, future lto testing.Roman Lebedev2017-12-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. The original attempt, r319525 was reverted in r319526 due to the failures in compiler-rt standalone builds. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 llvm-svn: 319575
* [PGO] Add a test case for infinite loopsXinliang David Li2017-11-301-0/+30
| | | | | | Differential Revision: http://reviews.llvm.org/D40663 llvm-svn: 319463
* Adjust test after r318159Adam Nemet2017-11-141-0/+1
| | | | llvm-svn: 318170
* Disable profile tests on Android.Evgeniy Stepanov2017-10-111-0/+3
| | | | | | They never actually worked, but this way they are not included in "check-all". llvm-svn: 315511
* [profile] Update Linux-only tests after r313597Vedant Kumar2017-09-192-2/+2
| | | | | | | Addresses bot failure: http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/9803 llvm-svn: 313602
* Resubmit "[lit] Force site configs to run before source-tree configs"Zachary Turner2017-09-151-11/+0
| | | | | | | | | | | | | | | | | | | | This is a resubmission of r313270. It broke standalone builds of compiler-rt because we were not correctly generating the llvm-lit script in the standalone build directory. The fixes incorporated here attempt to find llvm/utils/llvm-lit from the source tree returned by llvm-config. If present, it will generate llvm-lit into the output directory. Regardless, the user can specify -DLLVM_EXTERNAL_LIT to point to a specific lit.py on their file system. This supports the use case of someone installing lit via a package manager. If it cannot find a source tree, and -DLLVM_EXTERNAL_LIT is either unspecified or invalid, then we print a warning that tests will not be able to run. Differential Revision: https://reviews.llvm.org/D37756 llvm-svn: 313407
* Revert "[lit] Force site configs to run before source-tree configs"Zachary Turner2017-09-151-0/+11
| | | | | | | | This patch is still breaking several multi-stage compiler-rt bots. I already know what the fix is, but I want to get the bots green for now and then try re-applying in the morning. llvm-svn: 313335
* [lit] Force site configs to be run before source-tree configsZachary Turner2017-09-141-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch simplifies LLVM's lit infrastructure by enforcing an ordering that a site config is always run before a source-tree config. A significant amount of the complexity from lit config files arises from the fact that inside of a source-tree config file, we don't yet know if the site config has been run. However it is *always* required to run a site config first, because it passes various variables down through CMake that the main config depends on. As a result, every config file has to do a bunch of magic to try to reverse-engineer the location of the site config file if they detect (heuristically) that the site config file has not yet been run. This patch solves the problem by emitting a mapping from source tree config file to binary tree site config file in llvm-lit.py. Then, during discovery when we find a config file, we check to see if we have a target mapping for it, and if so we use that instead. This mechanism is generic enough that it does not affect external users of lit. They will just not have a config mapping defined, and everything will work as normal. On the other hand, for us it allows us to make many simplifications: * We are guaranteed that a site config will be executed first * Inside of a main config, we no longer have to assume that attributes might not be present and use getattr everywhere. * We no longer have to pass parameters such as --param llvm_site_config=<path> on the command line. * It is future-proof, meaning you don't have to edit llvm-lit.in to add support for new projects. * All of the duplicated logic of trying various fallback mechanisms of finding a site config from the main config are now gone. One potentially noteworthy thing that was required to implement this change is that whereas the ninja check targets previously used the first method to spawn lit, they now use the second. In particular, you can no longer run lit.py against the source tree while specifying the various `foo_site_config=<path>` parameters. Instead, you need to run llvm-lit.py. Differential Revision: https://reviews.llvm.org/D37756 llvm-svn: 313270
* Revert: Enable profile on NetBSDKamil Rytarowski2017-08-151-1/+1
| | | | | | | | Requested by V.Kumar. Not all tests pass. llvm-svn: 310912
* Revert r310857 due to internal test failureXinliang David Li2017-08-151-17/+1
| | | | llvm-svn: 310907
* [PGO] Add support for relocate profile dumping directoryXinliang David Li2017-08-141-1/+17
| | | | | | Differential Revsion: http://reviews.llvm.org/D36648 llvm-svn: 310857
OpenPOWER on IntegriCloud