[llvm] r218138 - llvm-cov: Prevent a test from matching its own check lines

Justin Bogner mail at justinbogner.com
Fri Sep 19 12:04:08 PDT 2014


Author: bogner
Date: Fri Sep 19 14:04:08 2014
New Revision: 218138

URL: http://llvm.org/viewvc/llvm-project?rev=218138&view=rev
Log:
llvm-cov: Prevent a test from matching its own check lines

Since llvm-cov shows the source file in its output, be careful about
potentially matching the check lines themselves.

Modified:
    llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.covmapping
    llvm/trunk/test/tools/llvm-cov/showExpansions.cpp

Modified: llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.covmapping
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.covmapping?rev=218138&r1=218137&r2=218138&view=diff
==============================================================================
Binary files llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.covmapping (original) and llvm/trunk/test/tools/llvm-cov/Inputs/showExpansions.covmapping Fri Sep 19 14:04:08 2014 differ

Modified: llvm/trunk/test/tools/llvm-cov/showExpansions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/showExpansions.cpp?rev=218138&r1=218137&r2=218138&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/showExpansions.cpp (original)
+++ llvm/trunk/test/tools/llvm-cov/showExpansions.cpp Fri Sep 19 14:04:08 2014
@@ -16,16 +16,14 @@
     else                   \
       ANOTHER_THING();     \
   } while (0)
+// CHECK-DAG: Expansion at line [[@LINE-4]], 7 -> 24
+// CHECK-DAG: Expansion at line [[@LINE-3]], 7 -> 20
 
 int main(int argc, const char *argv[]) {
   for (int i = 0; i < 100; ++i)
-    DO_SOMETHING(i);
+    DO_SOMETHING(i); // CHECK-DAG: Expansion at line [[@LINE]], 5 -> 17
   return 0;
 }
 
-// CHECK: Expansion at line 22, 5 -> 17
-// CHECK: Expansion at line 15, 7 -> 24
-// CHECK: Expansion at line 17, 7 -> 20
-
 // llvm-cov doesn't work on big endian yet
 // XFAIL: powerpc64-, s390x, mips-, mips64-, sparc





More information about the llvm-commits mailing list