llvm-cov: Prevent a test from matching its own check lines
authorJustin Bogner <mail@justinbogner.com>
Fri, 19 Sep 2014 19:04:08 +0000 (19:04 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 19 Sep 2014 19:04:08 +0000 (19:04 +0000)
Since llvm-cov shows the source file in its output, be careful about
potentially matching the check lines themselves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218138 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-cov/Inputs/showExpansions.covmapping
test/tools/llvm-cov/showExpansions.cpp

index 67337675cf43601873952ab7d04c3316ec43d6e3..b8c7d9711afe58085452d69d030c0e3d1b2ba1a6 100644 (file)
Binary files a/test/tools/llvm-cov/Inputs/showExpansions.covmapping and b/test/tools/llvm-cov/Inputs/showExpansions.covmapping differ
index 610d50095319ab71de0c0fa15a574904972230d0..30edd90584f8bfdd16de9527ed0db69a5dd1c617 100644 (file)
     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