diff options
author | Vedant Kumar <vsk@apple.com> | 2016-09-23 18:57:32 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-09-23 18:57:32 +0000 |
commit | bc6479850e1d4a4522c6d195f93704d3e78e54e3 (patch) | |
tree | a62afdc088765fcce12312bec7d6ff6d785b044a /llvm/test/tools/llvm-cov/scan-directory.test | |
parent | 224ef8d73bb49c765ac8d7a352b244ec7c24807e (diff) | |
download | bcm5719-llvm-bc6479850e1d4a4522c6d195f93704d3e78e54e3.tar.gz bcm5719-llvm-bc6479850e1d4a4522c6d195f93704d3e78e54e3.zip |
[llvm-cov] Get rid of all invalid filename references
We used to append filenames into a vector of std::string, and then
append a reference to each string into a separate vector. This made it
easier to work with the getUniqueSourceFiles API. But it's buggy.
std::string has a small-string optimization, so you can't expect to
capture a reference to one if you're copying it into a growing vector.
Add a test that triggers this invalid reference to std::string scenario,
and kill the issue with fire by just using ArrayRef<std::string>
everywhere.
llvm-svn: 282281
Diffstat (limited to 'llvm/test/tools/llvm-cov/scan-directory.test')
-rw-r--r-- | llvm/test/tools/llvm-cov/scan-directory.test | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/test/tools/llvm-cov/scan-directory.test b/llvm/test/tools/llvm-cov/scan-directory.test index 9bacfc209dd..b7f28584267 100644 --- a/llvm/test/tools/llvm-cov/scan-directory.test +++ b/llvm/test/tools/llvm-cov/scan-directory.test @@ -2,8 +2,18 @@ RUN: mkdir -p %t/a/b/ RUN: echo "" > %t/a/b/c.tmp RUN: echo "" > %t/a/d.tmp -RUN: llvm-cov show /dev/null -instr-profile /dev/null -dump-collected-paths %t | FileCheck %s -RUN: llvm-cov show /dev/null -instr-profile /dev/null -dump-collected-paths %t/a/b/c.tmp %t/a/d.tmp | FileCheck %s +RUN: llvm-cov show /dev/null -instr-profile /dev/null -dump-collected-paths %t | FileCheck %s --check-prefix=REAL +RUN: llvm-cov show /dev/null -instr-profile /dev/null -dump-collected-paths %t/a/b/c.tmp %t/a/d.tmp | FileCheck %s --check-prefix=REAL -CHECK-DAG: {{.*}}c.tmp -CHECK-DAG: {{.*}}d.tmp +REAL-DAG: {{.*}}c.tmp +REAL-DAG: {{.*}}d.tmp + +RUN: llvm-cov show /dev/null -instr-profile /dev/null -dump-collected-paths -filename-equivalence %t a b c d e f | FileCheck %s --check-prefix=EQUIV +EQUIV-DAG: {{.*}}c.tmp +EQUIV-DAG: {{.*}}d.tmp +EQUIV-DAG: a +EQUIV-DAG: b +EQUIV-DAG: c +EQUIV-DAG: d +EQUIV-DAG: e +EQUIV-DAG: f |