llvm/test/tools/llvm-cov/scan-directory.test
Vedant Kumar fd066351a5 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:32 +00:00

20 lines
645 B
Plaintext

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 --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
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