Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / llvm-cov / directory_coverage.linux.test
blob5db76c5ab833f4dc8c93b59109dfa30d5dfc9bcb
1 # REQUIRES: system-linux
2 # RUN: mkdir -p %t
4 # RUN: llvm-cov show %S/Inputs/directory_coverage/main.covmapping \
5 # RUN:   --instr-profile %S/Inputs/directory_coverage/main.profdata \
6 # RUN:   --path-equivalence=/tmp/directory_coverage,%S/Inputs/directory_coverage \
7 # RUN:   --format=text --show-directory-coverage -o %t/report-text
9 # RUN: llvm-cov show %S/Inputs/directory_coverage/main.covmapping \
10 # RUN:   --instr-profile %S/Inputs/directory_coverage/main.profdata \
11 # RUN:   --path-equivalence=/tmp/directory_coverage,%S/Inputs/directory_coverage \
12 # RUN:   --format=html --show-directory-coverage -o %t/report-html
14 # RUN: FileCheck --input-file %t/report-text/index.txt %s --check-prefix=ROOT
15 # RUN: FileCheck --input-file %t/report-text/coverage/tmp/directory_coverage/index.txt %s --check-prefix=ROOT
16 # RUN: FileCheck --input-file %t/report-text/coverage/tmp/directory_coverage/b0/index.txt %s --check-prefix=B0
17 # RUN: FileCheck --input-file %t/report-text/coverage/tmp/directory_coverage/c0/c1/index.txt %s --check-prefix=C1
19 # RUN: FileCheck --input-file %t/report-html/index.html %s --check-prefix=HTML-TOP --allow-empty
20 # RUN: FileCheck --input-file %t/report-html/coverage/tmp/directory_coverage/index.html %s --check-prefix=ROOT
21 # RUN: FileCheck --input-file %t/report-html/coverage/tmp/directory_coverage/b0/index.html %s --check-prefix=B0
22 # RUN: FileCheck --input-file %t/report-html/coverage/tmp/directory_coverage/c0/c1/index.html %s --check-prefix=C1
26 # HTML-TOP: coverage/index.html
28 # ROOT: a0/a1/a2.cc
29 # ROOT: b0/
30 # ROOT-NOT: b1_1.cc
31 # ROOT-NOT: b1_2.cc
32 # ROOT: c0/c1/
33 # ROOT-NOT: c2_1.cc
34 # ROOT-NOT: b2_2.cc
35 # ROOT: main.cc
37 # B0: b1_1.cc
38 # B0: b1_2.cc
40 # C1: c2.h
41 # C1: c2_1.cc
44 For regenerating the test:
46 cp -r %S/Inputs/directory_coverage /tmp
47 cd /tmp/directory_coverage
48 clang -fprofile-instr-generate -fcoverage-mapping -mllvm -enable-name-compression=false \
49   -o main main.cc a0/a1/a2.cc b0/b1_1.cc b0/b1_2.cc c0/c1/c2_1.cc c0/c1/c2_2.cc
50 ./main
51 llvm-cov convert-for-testing main -o main.covmapping
52 llvm-profdata merge default.profraw -o main.profdata
53 rm main default.profraw