[llvm] ae36790 - test/llvm-cov: Regenerate MC/DC tests (#80610)

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 4 14:43:22 PST 2024


Author: NAKAMURA Takumi
Date: 2024-02-05T07:43:18+09:00
New Revision: ae36790be4a2a6c9dc8900f659c861647cab66d5

URL: https://github.com/llvm/llvm-project/commit/ae36790be4a2a6c9dc8900f659c861647cab66d5
DIFF: https://github.com/llvm/llvm-project/commit/ae36790be4a2a6c9dc8900f659c861647cab66d5.diff

LOG: test/llvm-cov: Regenerate MC/DC tests (#80610)

* Revise instructions for regeneration, not to create executables.
* Add instructions to regenerate both object files and test vectors
(except for `mcdc-general-none.proftext`)
* Reformat

Added: 
    

Modified: 
    llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.cpp
    llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o
    llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.proftext
    llvm/test/tools/llvm-cov/Inputs/mcdc-const.cpp
    llvm/test/tools/llvm-cov/Inputs/mcdc-const.o
    llvm/test/tools/llvm-cov/Inputs/mcdc-const.proftext
    llvm/test/tools/llvm-cov/Inputs/mcdc-general.cpp
    llvm/test/tools/llvm-cov/Inputs/mcdc-general.o
    llvm/test/tools/llvm-cov/Inputs/mcdc-general.proftext
    llvm/test/tools/llvm-cov/mcdc-const.test
    llvm/test/tools/llvm-cov/mcdc-general-none.test
    llvm/test/tools/llvm-cov/mcdc-general.test

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.cpp b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.cpp
index 75f35bd059eb1..11e5fb976b67c 100644
--- a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.cpp
+++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.cpp
@@ -75,10 +75,6 @@ bool casen(bool a, bool b) {
     return b || 0 || a;
 }
 
-extern "C" {
-  extern void __llvm_profile_write_file(void);
-}
-
 int main(int argc, char *argv[])
 {
     bool a = atoi(argv[1]);
@@ -112,6 +108,5 @@ int main(int argc, char *argv[])
     c = casem(a, b);
     c = casen(a, b);
 
-    __llvm_profile_write_file();
     return 0;
 }

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o
old mode 100755
new mode 100644
index 2fb33f3f601a3..4f54fa7b8a1a1
Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o and b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.o 
diff er

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.proftext b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.proftext
index eaac8048f0ceb..82335a8195faa 100644
--- a/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.proftext
+++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-const-folding.proftext
@@ -1,149 +1,141 @@
-_Z5case8bb
+_Z5case0b
 # Func Hash:
-99214
+1550
 # Num Counters:
-5
+3
 # Counter Values:
 4
 0
 0
-0
-0
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
+# Bitmap Byte Values:
 0x1
 
 
-_Z5case5b
+_Z5case1b
 # Func Hash:
-1551
+1550
 # Num Counters:
 3
 # Counter Values:
 4
-1
+3
 0
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x6
+# Bitmap Byte Values:
+0x3
 
 
-_Z5caseabb
+_Z5case2b
 # Func Hash:
-99214
+1550
 # Num Counters:
-5
+3
 # Counter Values:
 4
-3
-2
 4
 3
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0xa2
+# Bitmap Byte Values:
+0xa
 
 
-_Z5case6b
+_Z5case3b
 # Func Hash:
-1551
+1550
 # Num Counters:
 3
 # Counter Values:
 4
-4
-1
-# Num Bitmask Bytes:
+3
+3
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x5
+# Bitmap Byte Values:
+0x9
 
 
-_Z5casegbb
+_Z5case4b
 # Func Hash:
-99214
+1551
 # Num Counters:
-5
+3
 # Counter Values:
 4
-2
 0
-3
-2
-# Num Bitmask Bytes:
+0
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x23
+# Bitmap Byte Values:
+0x2
 
 
-_Z5case1b
+_Z5case5b
 # Func Hash:
-1550
+1551
 # Num Counters:
 3
 # Counter Values:
 4
-3
+1
 0
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x3
+# Bitmap Byte Values:
+0x6
 
 
-_Z5case7b
+_Z5case6b
 # Func Hash:
 1551
 # Num Counters:
 3
 # Counter Values:
 4
+4
 1
-1
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x3
+# Bitmap Byte Values:
+0x5
 
 
-_Z5casedbb
+_Z5case7b
 # Func Hash:
-99279
+1551
 # Num Counters:
-5
+3
 # Counter Values:
 4
-0
-0
 1
-0
-# Num Bitmask Bytes:
+1
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x12
+# Bitmap Byte Values:
+0x3
 
 
-_Z5casekbb
+_Z5case8bb
 # Func Hash:
-99279
+99214
 # Num Counters:
 5
 # Counter Values:
 4
 0
 0
-1
 0
-# Num Bitmask Bytes:
+0
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x12
+# Bitmap Byte Values:
+0x1
 
 
-_Z5casehbb
+_Z5case9bb
 # Func Hash:
 99214
 # Num Counters:
@@ -154,94 +146,98 @@ _Z5casehbb
 0
 3
 0
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
+# Bitmap Byte Values:
 0x3
 
 
-_Z5case4b
+_Z5caseabb
 # Func Hash:
-1551
+99214
 # Num Counters:
-3
+5
 # Counter Values:
 4
-0
-0
-# Num Bitmask Bytes:
+3
+2
+4
+3
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x2
+# Bitmap Byte Values:
+0xa2
 
 
-_Z5caseibb
+_Z5casebbb
 # Func Hash:
 99214
 # Num Counters:
 5
 # Counter Values:
 4
-2
-2
 3
 2
-# Num Bitmask Bytes:
+3
+3
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x83
+# Bitmap Byte Values:
+0xa1
 
 
-_Z5case2b
+_Z5casecbb
 # Func Hash:
-1550
+99279
 # Num Counters:
-3
+5
 # Counter Values:
 4
-4
-3
-# Num Bitmask Bytes:
+0
+0
+0
+0
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0xa
+# Bitmap Byte Values:
+0x2
 
 
-_Z5casefbb
+_Z5casedbb
 # Func Hash:
 99279
 # Num Counters:
 5
 # Counter Values:
 4
-1
+0
 0
 1
-1
-# Num Bitmask Bytes:
+0
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x6
+# Bitmap Byte Values:
+0x12
 
 
-_Z5caselbb
+_Z5caseebb
 # Func Hash:
 99279
 # Num Counters:
 5
 # Counter Values:
 4
-0
-0
 1
 0
-# Num Bitmask Bytes:
+4
+1
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x12
+# Bitmap Byte Values:
+0x14
 
 
-_Z5casenbb
+_Z5casefbb
 # Func Hash:
 99279
 # Num Counters:
@@ -252,76 +248,61 @@ _Z5casenbb
 0
 1
 1
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
+# Bitmap Byte Values:
 0x6
 
 
-_Z5case9bb
+_Z5casegbb
 # Func Hash:
 99214
 # Num Counters:
 5
 # Counter Values:
 4
-0
+2
 0
 3
-0
-# Num Bitmask Bytes:
+2
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x3
+# Bitmap Byte Values:
+0x23
 
 
-_Z5casecbb
+_Z5casehbb
 # Func Hash:
-99279
+99214
 # Num Counters:
 5
 # Counter Values:
 4
 0
 0
+3
 0
-0
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x2
+# Bitmap Byte Values:
+0x3
 
 
-_Z5casebbb
+_Z5caseibb
 # Func Hash:
 99214
 # Num Counters:
 5
 # Counter Values:
 4
-3
+2
 2
 3
-3
-# Num Bitmask Bytes:
-$1
-# Bitmask Byte Values:
-0xa1
-
-
-_Z5case0b
-# Func Hash:
-1550
-# Num Counters:
-3
-# Counter Values:
-4
-0
-0
-# Num Bitmask Bytes:
+2
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x1
+# Bitmap Byte Values:
+0x83
 
 
 _Z5casejbb
@@ -335,64 +316,85 @@ _Z5casejbb
 2
 3
 3
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
+# Bitmap Byte Values:
 0xa1
 
 
-_Z5caseebb
+_Z5casekbb
 # Func Hash:
 99279
 # Num Counters:
 5
 # Counter Values:
 4
-1
 0
-4
+0
 1
-# Num Bitmask Bytes:
+0
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x14
+# Bitmap Byte Values:
+0x12
 
 
-main
+_Z5caselbb
 # Func Hash:
-24
+99279
 # Num Counters:
-1
+5
 # Counter Values:
 4
+0
+0
+1
+0
+# Num Bitmap Bytes:
+$1
+# Bitmap Byte Values:
+0x12
 
-_Z5case3b
+
+_Z5casembb
 # Func Hash:
-1550
+99279
 # Num Counters:
-3
+5
 # Counter Values:
 4
-3
-3
-# Num Bitmask Bytes:
+0
+0
+1
+0
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x9
+# Bitmap Byte Values:
+0x12
 
 
-_Z5casembb
+_Z5casenbb
 # Func Hash:
 99279
 # Num Counters:
 5
 # Counter Values:
 4
-0
-0
 1
 0
-# Num Bitmask Bytes:
+1
+1
+# Num Bitmap Bytes:
 $1
-# Bitmask Byte Values:
-0x12
+# Bitmap Byte Values:
+0x6
+
+
+main
+# Func Hash:
+24
+# Num Counters:
+1
+# Counter Values:
+4
+

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.cpp b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.cpp
index 4a777d11ae1f2..687baea6b911c 100644
--- a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.cpp
+++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.cpp
@@ -1,11 +1,11 @@
-
 #include <stdio.h>
 
-extern "C" {
-extern void __llvm_profile_write_file(void);
-}
 
-extern int foo();
+
+
+
+
+
 
 void test(bool a, bool b, bool c, bool d) {
 
@@ -22,6 +22,5 @@ int main()
 
     test(true,false,false,false);
 
-    __llvm_profile_write_file();
     return 0;
 }

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.o
old mode 100755
new mode 100644
index 092c2a3e8402e..1232088ee60fa
Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.o and b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.o 
diff er

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.proftext b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.proftext
index 86ac65eb779ac..10253f26e0a68 100644
--- a/llvm/test/tools/llvm-cov/Inputs/mcdc-const.proftext
+++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-const.proftext
@@ -1,11 +1,3 @@
-main
-# Func Hash:
-24
-# Num Counters:
-1
-# Counter Values:
-1
-
 _Z4testbbbb
 # Func Hash:
 703556281489
@@ -21,10 +13,20 @@ _Z4testbbbb
 4
 0
 0
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $4
-# Bitmask Byte Values:
+# Bitmap Byte Values:
+0x1
+0x2
+0x0
+0x0
+
+
+main
+# Func Hash:
+24
+# Num Counters:
 1
-2
-0
-0
+# Counter Values:
+1
+

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.cpp b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.cpp
index d1ce365d78074..030ad7e4c17d4 100644
--- a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.cpp
+++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.cpp
@@ -1,11 +1,11 @@
-
 #include <stdio.h>
 
-extern "C" {
-extern void __llvm_profile_write_file(void);
-}
 
-extern int foo();
+
+
+
+
+
 
 void test(bool a, bool b, bool c, bool d) {
 
@@ -31,6 +31,6 @@ int main()
     test(true,true,true,true);
     test(false,true,true,false);
 
-    __llvm_profile_write_file();
+    (void)0;
     return 0;
 }

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.o b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.o
old mode 100755
new mode 100644
index 4044be1ca3886..afe6f95cf0b82
Binary files a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.o and b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.o 
diff er

diff  --git a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.proftext b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.proftext
index eadc9157c72cd..a83f036ddf2c9 100644
--- a/llvm/test/tools/llvm-cov/Inputs/mcdc-general.proftext
+++ b/llvm/test/tools/llvm-cov/Inputs/mcdc-general.proftext
@@ -1,11 +1,3 @@
-main
-# Func Hash:
-24
-# Num Counters:
-1
-# Counter Values:
-1
-
 _Z4testbbbb
 # Func Hash:
 9819241276358969079
@@ -31,12 +23,22 @@ _Z4testbbbb
 2
 2
 1
-# Num Bitmask Bytes:
+# Num Bitmap Bytes:
 $6
-# Bitmask Byte Values:
+# Bitmap Byte Values:
 0x2f
 0x8
 0xb
 0x9
 0x83
 0x80
+
+
+main
+# Func Hash:
+24
+# Num Counters:
+1
+# Counter Values:
+1
+

diff  --git a/llvm/test/tools/llvm-cov/mcdc-const.test b/llvm/test/tools/llvm-cov/mcdc-const.test
index bf9d34b09da0f..0b2c9c98d5355 100644
--- a/llvm/test/tools/llvm-cov/mcdc-const.test
+++ b/llvm/test/tools/llvm-cov/mcdc-const.test
@@ -1,9 +1,9 @@
 // Test visualization of MC/DC constructs for constant-folded condition masking.
 
 // RUN: llvm-profdata merge %S/Inputs/mcdc-const.proftext -o %t.profdata
-// RUN: llvm-cov show --show-branches=count --show-mcdc %S/Inputs/mcdc-const.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-const.cpp | FileCheck %s -check-prefix=CHECKGENERALCASE
+// RUN: llvm-cov show --show-branches=count --show-mcdc %S/Inputs/mcdc-const.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s -check-prefix=CHECKGENERALCASE
 
-// CHECKGENERALCASE:  ------------------
+//      CHECKGENERALCASE:  ------------------
 // CHECKGENERALCASE-NEXT:  |  Branch (12:8): [True: 4, False: 1]
 // CHECKGENERALCASE-NEXT:  |  Branch (12:13): [Folded - Ignored]
 // CHECKGENERALCASE-NEXT:  |  Branch (12:20): [Folded - Ignored]
@@ -35,148 +35,148 @@
 // CHECKGENERALCASE-NEXT:  ------------------
 
 // RUN: llvm-profdata merge %S/Inputs/mcdc-const-folding.proftext -o %t.profdata
-// RUN: llvm-cov show --show-mcdc %S/Inputs/mcdc-const-folding.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-const-folding.cpp | FileCheck %s -check-prefix=CHECKFULLCASE
-// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-const-folding.o -instr-profile %t.profdata -show-functions -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-const-folding.cpp | FileCheck %s -check-prefix=REPORT
+// RUN: llvm-cov show --show-mcdc %S/Inputs/mcdc-const-folding.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s -check-prefix=CHECKFULLCASE
+// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-const-folding.o -instr-profile %t.profdata -show-functions -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-const-folding.cpp | FileCheck %s -check-prefix=REPORT
 
-// CHECKFULLCASE: |  1 { C,  -  = F      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  1 { C,  -  = F      }
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { F,  C  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { F,  C  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  C  = F      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { C,  F  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { C,  F  = F      }
 // CHECKFULLCASE-NEXT: |  2 { C,  T  = T      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: covered: (1,2)
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { F,  C  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { F,  C  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  C  = T      }
-// CHECKFULLCASE: |  C1-Pair: covered: (1,2)
+//      CHECKFULLCASE: |  C1-Pair: covered: (1,2)
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { C,  -  = T      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { C,  -  = T      }
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { T,  C  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { T,  C  = T      }
 // CHECKFULLCASE-NEXT: |  2 { F,  C  = T      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { C,  F  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { C,  F  = F      }
 // CHECKFULLCASE-NEXT: |  2 { C,  T  = T      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: covered: (1,2)
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { F,  C  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { F,  C  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  C  = T      }
-// CHECKFULLCASE: |  C1-Pair: covered: (1,2)
+//      CHECKFULLCASE: |  C1-Pair: covered: (1,2)
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { C,  -,  -  = F      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { C,  -,  -  = F      }
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { F,  C,  -  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { F,  C,  -  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  C,  -  = F      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { C,  F,  -  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { C,  F,  -  = F      }
 // CHECKFULLCASE-NEXT: |  2 { C,  T,  F  = F      }
 // CHECKFULLCASE-NEXT: |  3 { C,  T,  T  = T      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: covered: (1,3)
 // CHECKFULLCASE-NEXT: |  C3-Pair: covered: (2,3)
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { F,  C,  -  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { F,  C,  -  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  C,  F  = F      }
 // CHECKFULLCASE-NEXT: |  3 { T,  C,  T  = T      }
-// CHECKFULLCASE: |  C1-Pair: covered: (1,3)
+//      CHECKFULLCASE: |  C1-Pair: covered: (1,3)
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: covered: (2,3)
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { C,  -,  -  = T      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { C,  -,  -  = T      }
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { T,  C,  -  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { T,  C,  -  = T      }
 // CHECKFULLCASE-NEXT: |  2 { F,  C,  -  = T      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { C,  F,  T  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { C,  F,  T  = T      }
 // CHECKFULLCASE-NEXT: |  2 { C,  T,  -  = T      }
-// CHECKFULLCASE: |  C1-Pair: constant folded
+//      CHECKFULLCASE: |  C1-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { T,  C,  -  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { T,  C,  -  = T      }
 // CHECKFULLCASE-NEXT: |  2 { F,  C,  T  = T      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { F,  -,  C  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { F,  -,  C  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  F,  C  = F      }
 // CHECKFULLCASE-NEXT: |  3 { T,  T,  C  = F      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C3-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { F,  C,  -  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { F,  C,  -  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  C,  -  = F      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { F,  -,  C  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { F,  -,  C  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  F,  C  = F      }
 // CHECKFULLCASE-NEXT: |  3 { T,  T,  C  = T      }
-// CHECKFULLCASE: |  C1-Pair: covered: (1,3)
+//      CHECKFULLCASE: |  C1-Pair: covered: (1,3)
 // CHECKFULLCASE-NEXT: |  C2-Pair: covered: (2,3)
 // CHECKFULLCASE-NEXT: |  C3-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { F,  C,  -  = F      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { F,  C,  -  = F      }
 // CHECKFULLCASE-NEXT: |  2 { T,  C,  F  = F      }
 // CHECKFULLCASE-NEXT: |  3 { T,  C,  T  = T      }
-// CHECKFULLCASE: |  C1-Pair: covered: (1,3)
+//      CHECKFULLCASE: |  C1-Pair: covered: (1,3)
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: covered: (2,3)
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
-// CHECKFULLCASE: |  1 { T,  -,  C  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 100.00%
+//      CHECKFULLCASE: |  1 { T,  -,  C  = T      }
 // CHECKFULLCASE-NEXT: |  2 { F,  T,  C  = T      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C3-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { T,  C,  -  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { T,  C,  -  = T      }
 // CHECKFULLCASE-NEXT: |  2 { F,  C,  -  = T      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { T,  -,  C  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { T,  -,  C  = T      }
 // CHECKFULLCASE-NEXT: |  2 { F,  T,  C  = T      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C3-Pair: constant folded
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
-// CHECKFULLCASE: |  1 { T,  C,  -  = T      }
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  1 { T,  C,  -  = T      }
 // CHECKFULLCASE-NEXT: |  2 { F,  C,  T  = T      }
-// CHECKFULLCASE: |  C1-Pair: not covered
+//      CHECKFULLCASE: |  C1-Pair: not covered
 // CHECKFULLCASE-NEXT: |  C2-Pair: constant folded
 // CHECKFULLCASE-NEXT: |  C3-Pair: not covered
-// CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
+//      CHECKFULLCASE: |  MC/DC Coverage for Decision: 0.00%
 
-// REPORT: _Z5case0b {{.*}} 1       1   0.00%
+//      REPORT: _Z5case0b {{.*}} 1       1   0.00%
 // REPORT-NEXT: _Z5case1b {{.*}} 1       1   0.00%
 // REPORT-NEXT: _Z5case2b {{.*}} 1       0 100.00%
 // REPORT-NEXT: _Z5case3b {{.*}} 1       0 100.00%
@@ -200,19 +200,29 @@
 // REPORT-NEXT: _Z5caselbb {{.*}} 2       2   0.00%
 // REPORT-NEXT: _Z5casembb {{.*}} 2       2   0.00%
 // REPORT-NEXT: _Z5casenbb {{.*}} 2       2   0.00%
-// REPORT: TOTAL {{.*}} 40      28  30.00%
+//      REPORT: TOTAL {{.*}} 40      28  30.00%
 
 Instructions for regenerating the test:
 
-# cd %S/Inputs
-cp mcdc-const.cpp /tmp
-cp mcdc-const-folding.cpp /tmp
+cd %S/Inputs # Or copy files into the working directory
 
-clang -fcoverage-mcdc -fprofile-instr-generate -fcoverage-compilation-dir=. \
-    -fcoverage-mapping /tmp/mcdc-const.cpp -o /tmp/mcdc-const.o
+clang++ -c -Os \
+    -fcoverage-compilation-dir=. -mllvm -enable-name-compression=false \
+    -fcoverage-mcdc -fprofile-instr-generate -fcoverage-mapping \
+    mcdc-const.cpp mcdc-const-folding.cpp
 
-clang -fcoverage-mcdc -fprofile-instr-generate -fcoverage-compilation-dir=. \
-    -fcoverage-mapping /tmp/mcdc-const-folding.cpp -o /tmp/mcdc-const-folding.o
+# Instructions for regenerating proftext
 
-mv /tmp/mcdc-const.o %S/Inputs
-mv /tmp/mcdc-const-folding.o %S/Inputs
+for x in mcdc-const mcdc-const-folding; do (
+  clang++ -fprofile-instr-generate $x.o -o $x
+  find -name '*.profraw' | xargs rm -f
+  export LLVM_PROFILE_FILE=$x-%p.profraw
+  ./$x 0 1
+  if [ "$x" = "mcdc-const-folding" ]; then
+    ./$x 1 0
+    ./$x 1 1
+    ./$x 1 1 # Redundant
+  fi
+  llvm-profdata merge --sparse -o $x.profdata $(find -name '*.profraw')
+  llvm-profdata merge --text -o $x.proftext $x.profdata
+); done

diff  --git a/llvm/test/tools/llvm-cov/mcdc-general-none.test b/llvm/test/tools/llvm-cov/mcdc-general-none.test
index bcf8f3cbd05d4..07700cb51fa5e 100644
--- a/llvm/test/tools/llvm-cov/mcdc-general-none.test
+++ b/llvm/test/tools/llvm-cov/mcdc-general-none.test
@@ -1,12 +1,12 @@
 // Test visualization of general MC/DC constructs with 0 executed test vectors.
 
 // RUN: llvm-profdata merge %S/Inputs/mcdc-general-none.proftext -o %t.profdata
-// RUN: llvm-cov show --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s
-// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT
+// RUN: llvm-cov show --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s
+// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT
 
-// CHECK: test(bool
+//      CHECK: test(bool
 
-// CHECK:  ------------------
+//      CHECK:  ------------------
 // CHECK-NEXT:  |---> MC/DC Decision Region (12:7) to (12:27)
 // CHECK-NEXT:  |
 // CHECK-NEXT:  |  Number of Conditions: 4
@@ -29,10 +29,10 @@
 
 
 // Turn off MC/DC visualization.
-// RUN: llvm-cov show %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=NOMCDC
+// RUN: llvm-cov show %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s -check-prefix=NOMCDC
 // NOMCDC-NOT: MC/DC Decision Region
 
-// REPORT: Name                        Regions    Miss   Cover     Lines    Miss   Cover  Branches    Miss   Cover    MC/DC Conditions    Miss   Cover
+//      REPORT: Name                        Regions    Miss   Cover     Lines    Miss   Cover  Branches    Miss   Cover    MC/DC Conditions    Miss   Cover
 // REPORT-NEXT: -------------------------------------------------------------------------------------------------------------------------------------------
 // REPORT-NEXT: _Z4testbbbb                      25       0 100.00%         9       0 100.00%        24       2  91.67%                  12      12   0.00%
 // REPORT-NEXT: main                              1       0 100.00%        11       0 100.00%         0       0   0.00%                   0       0   0.00%
@@ -40,18 +40,19 @@
 // REPORT-NEXT: TOTAL                            26       0 100.00%        20       0 100.00%        24       2  91.67%                  12      12   0.00%
 
 // Turn off MC/DC summary.
-// RUN: llvm-cov report %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT_NOMCDC
+// RUN: llvm-cov report %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT_NOMCDC
 // REPORT_NOMCDC-NOT: TOTAL{{.*}}12                   12    0.00%
 
 
 // Test file-level report.
-// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=FILEREPORT
+// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=FILEREPORT
 // FILEREPORT: TOTAL{{.*}}12                   12    0.00%
 
 
 // Test html output.
-// RUN: llvm-cov show --show-mcdc-summary --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp -format html -o %t.html.dir
-// RUN: FileCheck -check-prefix=HTML -input-file=%t.html.dir/coverage/tmp/mcdc-general.cpp.html %s
+// RUN: rm -rf %t.html.dir
+// RUN: llvm-cov show --show-mcdc-summary --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs -format html -o %t.html.dir
+// RUN: FileCheck -check-prefix=HTML -input-file=%t.html.dir/coverage/mcdc-general.cpp.html %s
 // HTML-COUNT-4: MC/DC Decision Region (<span class='line-number'><a name='L{{[0-9]+}}' href='#L{{[0-9]+}}'><span>
 
 // RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s
@@ -71,12 +72,5 @@
 // HTML-INDEX: 0.00% (0/12)
 // HTML-INDEX: Totals
 
-Instructions for regenerating the test:
-
-# cd %S/Inputs
-cp mcdc-general.cpp /tmp
-
-clang -fcoverage-mcdc -fprofile-instr-generate -fcoverage-compilation-dir=. \
-    -fcoverage-mapping /tmp/mcdc-general.cpp -o /tmp/mcdc-general.o
-
-mv /tmp/mcdc-general.o %S/Inputs
+# How to regenerate Inputs/mcdc-general-none.proftext:
+# Copy Inputs/mcdc-general.proftext and replace all bitmap values with 0.

diff  --git a/llvm/test/tools/llvm-cov/mcdc-general.test b/llvm/test/tools/llvm-cov/mcdc-general.test
index 588aed09c16a5..753036bedaf17 100644
--- a/llvm/test/tools/llvm-cov/mcdc-general.test
+++ b/llvm/test/tools/llvm-cov/mcdc-general.test
@@ -1,12 +1,12 @@
 // Test visualization of general MC/DC constructs.
 
 // RUN: llvm-profdata merge %S/Inputs/mcdc-general.proftext -o %t.profdata
-// RUN: llvm-cov show --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s
-// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT
+// RUN: llvm-cov show --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s
+// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT
 
-// CHECK: test(bool
+//      CHECK: test(bool
 
-// CHECK:  ------------------
+//      CHECK:  ------------------
 // CHECK-NEXT:  |---> MC/DC Decision Region (12:7) to (12:27)
 // CHECK-NEXT:  |
 // CHECK-NEXT:  |  Number of Conditions: 4
@@ -33,7 +33,7 @@
 // CHECK-NEXT:  |
 // CHECK-NEXT:  ------------------
 
-// CHECK:  ------------------
+//      CHECK:  ------------------
 // CHECK-NEXT:  |---> MC/DC Decision Region (15:7) to (15:13)
 // CHECK-NEXT:  |
 // CHECK-NEXT:  |  Number of Conditions: 2
@@ -69,7 +69,7 @@
 // CHECK-NEXT:  |
 // CHECK-NEXT:  ------------------
 
-// CHECK:  ------------------
+//      CHECK:  ------------------
 // CHECK-NEXT:  |---> MC/DC Decision Region (18:7) to (19:15)
 // CHECK-NEXT:  |
 // CHECK-NEXT:  |  Number of Conditions: 4
@@ -95,10 +95,10 @@
 // CHECK-NEXT:  ------------------
 
 // Turn off MC/DC visualization.
-// RUN: llvm-cov show %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=NOMCDC
+// RUN: llvm-cov show %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %s -check-prefix=NOMCDC
 // NOMCDC-NOT: MC/DC Decision Region
 
-// REPORT: Name                        Regions    Miss   Cover     Lines    Miss   Cover  Branches    Miss   Cover    MC/DC Conditions    Miss   Cover
+//      REPORT: Name                        Regions    Miss   Cover     Lines    Miss   Cover  Branches    Miss   Cover    MC/DC Conditions    Miss   Cover
 // REPORT-NEXT: -------------------------------------------------------------------------------------------------------------------------------------------
 // REPORT-NEXT: _Z4testbbbb                      25       0 100.00%         9       0 100.00%        24       2  91.67%                  12       2  83.33%
 // REPORT-NEXT: main                              1       0 100.00%        11       0 100.00%         0       0   0.00%                   0       0   0.00%
@@ -106,18 +106,19 @@
 // REPORT-NEXT: TOTAL                            26       0 100.00%        20       0 100.00%        24       2  91.67%                  12       2  83.33%
 
 // Turn off MC/DC summary.
-// RUN: llvm-cov report %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT_NOMCDC
+// RUN: llvm-cov report %S/Inputs/mcdc-general.o -instr-profile %t.profdata -show-functions -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=REPORT_NOMCDC
 // REPORT_NOMCDC-NOT: TOTAL{{.*}}12                    2    83.33%
 
 
 // Test file-level report.
-// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=FILEREPORT
+// RUN: llvm-cov report --show-mcdc-summary %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs %S/Inputs/mcdc-general.cpp | FileCheck %s -check-prefix=FILEREPORT
 // FILEREPORT: TOTAL{{.*}}12                    2    83.33%
 
 
 // Test html output.
-// RUN: llvm-cov show --show-mcdc-summary --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/mcdc-general.cpp -format html -o %t.html.dir
-// RUN: FileCheck -check-prefix=HTML -input-file=%t.html.dir/coverage/tmp/mcdc-general.cpp.html %s
+// RUN: rm -rf %t.html.dir
+// RUN: llvm-cov show --show-mcdc-summary --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs -format html -o %t.html.dir
+// RUN: FileCheck -check-prefix=HTML -input-file=%t.html.dir/coverage/mcdc-general.cpp.html %s
 // HTML-COUNT-4: MC/DC Decision Region (<span class='line-number'><a name='L{{[0-9]+}}' href='#L{{[0-9]+}}'><span>
 
 // RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s
@@ -139,10 +140,19 @@
 
 Instructions for regenerating the test:
 
-# cd %S/Inputs
-cp mcdc-general.cpp /tmp
+cd %S/Inputs # Or copy mcdc-general.cpp into the working directory
 
-clang -fcoverage-mcdc -fprofile-instr-generate -fcoverage-compilation-dir=. \
-    -fcoverage-mapping /tmp/mcdc-general.cpp -o /tmp/mcdc-general.o
+clang++ -c -Os \
+    -fcoverage-compilation-dir=. -mllvm -enable-name-compression=false \
+    -fcoverage-mcdc -fprofile-instr-generate -fcoverage-mapping \
+    mcdc-general.cpp
 
-mv /tmp/mcdc-general.o %S/Inputs
+# Instructions for regenerating profdata
+
+for x in mcdc-general; do
+  clang++ -fprofile-instr-generate $x.o -o $x
+  find -name '*.profraw' | xargs rm -f
+  ./$x
+  llvm-profdata merge --sparse -o $x.profdata $(find -name '*.profraw')
+  llvm-profdata merge --text -o $x.proftext $x.profdata
+done


        


More information about the llvm-commits mailing list