[compiler-rt] 87d7254 - [Coverage] Fix coverage test cases.

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 18:01:53 PDT 2020


Author: Zequan Wu
Date: 2020-07-21T18:01:29-07:00
New Revision: 87d725473380652bbe845fd2fbd9c0507a55172f

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

LOG: [Coverage] Fix coverage test cases.

Added: 
    

Modified: 
    compiler-rt/test/profile/coverage_comments.cpp
    compiler-rt/test/profile/instrprof-set-file-object-merging.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/profile/coverage_comments.cpp b/compiler-rt/test/profile/coverage_comments.cpp
index 9220216f9acf..0cf78add7913 100644
--- a/compiler-rt/test/profile/coverage_comments.cpp
+++ b/compiler-rt/test/profile/coverage_comments.cpp
@@ -3,69 +3,69 @@
 // RUN: llvm-profdata merge -o %t.profdata %t.profraw
 // RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
 
-int main() {                           // CHECK:  [[# @LINE]]| 1|int main() {
-    /* comment */ int x = 0;           // CHECK:  [[# @LINE]]| 1|  /* comment */ int x = 0;
-    int y = 0; /* comment */           // CHECK:  [[# @LINE]]| 1|  int y = 0; /* comment */
-    int z = 0; // comment              // CHECK:  [[# @LINE]]| 1|  int z = 0; // comment
-    // comment                         // CHECK:  [[# @LINE]]|  |  // comment
-                                       // CHECK:  [[# @LINE]]|  |
-    x = 0; /*                          // CHECK:  [[# @LINE]]| 1|  x = 0; /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */                                 // CHECK:  [[# @LINE]]|  |    */
-                                       // CHECK:  [[# @LINE]]|  |
-    /*                                 // CHECK:  [[# @LINE]]|  |    /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */ x = 0;                          // CHECK:  [[# @LINE]]| 1|    */ x = 0;
-                                       // CHECK:  [[# @LINE]]|  |
-    /* comment */                      // CHECK:  [[# @LINE]]|  |    /* comment */
-    // comment                         // CHECK:  [[# @LINE]]|  |    // comment
-    /* comment */                      // CHECK:  [[# @LINE]]|  |    /* comment */
-    z =                                // CHECK:  [[# @LINE]]| 1|    z =
-    x // comment                       // CHECK:  [[# @LINE]]| 1|    x // comment
-    // comment                         // CHECK:  [[# @LINE]]|  |    // comment
-    + /*                               // CHECK:  [[# @LINE]]| 1|    + /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */                                 // CHECK:  [[# @LINE]]|  |    */
-    /*                                 // CHECK:  [[# @LINE]]|  |    /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */y;                               // CHECK:  [[# @LINE]]| 1|    */y;
-                                       // CHECK:  [[# @LINE]]|  |
-    // Comments inside directives.     // CHECK:  [[# @LINE]]|  |    // Comments inside directives.
-    #if 0 //comment                    // CHECK:  [[# @LINE]]|  |    #if 0 //comment
-    /* comment */ x = 0;               // CHECK:  [[# @LINE]]|  |    /* comment */ x = 0;
-    y = 0; /* comment */               // CHECK:  [[# @LINE]]|  |    y = 0; /* comment */
-    z = 0; // comment                  // CHECK:  [[# @LINE]]|  |    z = 0; // comment
-    // comment                         // CHECK:  [[# @LINE]]|  |    // comment
-                                       // CHECK:  [[# @LINE]]|  |
-    x = 0; /*                          // CHECK:  [[# @LINE]]|  |    x = 0; /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */                                 // CHECK:  [[# @LINE]]|  |    */
-                                       // CHECK:  [[# @LINE]]|  | 
-    /*                                 // CHECK:  [[# @LINE]]|  |    /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */ x = 0;                          // CHECK:  [[# @LINE]]|  |    */ x = 0;
-                                       // CHECK:  [[# @LINE]]|  |
-    /* comment */                      // CHECK:  [[# @LINE]]|  |    /* comment */
-    // comment                         // CHECK:  [[# @LINE]]|  |    // comment
-    /* comment */                      // CHECK:  [[# @LINE]]|  |    /* comment */
-    #endif // comment                  // CHECK:  [[# @LINE]]|  |    #endif // comment
-    #if 1 // comment                   // CHECK:  [[# @LINE]]| 1|    #if 1 // comment
-    /* comment */ x = 0;               // CHECK:  [[# @LINE]]| 1|    /* comment */ x = 0;
-    y = 0; /* comment */               // CHECK:  [[# @LINE]]| 1|    y = 0; /* comment */
-    z = 0; // comment                  // CHECK:  [[# @LINE]]| 1|    z = 0; // comment
-    // comment                         // CHECK:  [[# @LINE]]|  |    // comment
-                                       // CHECK:  [[# @LINE]]|  |
-    x = 0; /*                          // CHECK:  [[# @LINE]]| 1|    x = 0; /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */                                 // CHECK:  [[# @LINE]]|  |    */
-                                       // CHECK:  [[# @LINE]]|  |
-    /*                                 // CHECK:  [[# @LINE]]|  |    /*
-    comment                            // CHECK:  [[# @LINE]]|  |    comment
-    */ x = 0;                          // CHECK:  [[# @LINE]]| 1|    */ x = 0;
-                                       // CHECK:  [[# @LINE]]|  |
-    /* comment */                      // CHECK:  [[# @LINE]]|  |    /* comment */
-    // comment                         // CHECK:  [[# @LINE]]|  |    // comment
-    /* comment */                      // CHECK:  [[# @LINE]]|  |    /* comment */
-    #endif //comment                   // CHECK:  [[# @LINE]]| 1|    #endif //comment
-    return 0;                          // CHECK:  [[# @LINE]]| 1|    return 0;
-}                                      // CHECK:  [[# @LINE]]| 1|}
+int main() {                           // CHECK:       [[# @LINE]]| 1|int main() {
+    /* comment */ int x = 0;           // CHECK-NEXT:  [[# @LINE]]| 1|
+    int y = 0; /* comment */           // CHECK-NEXT:  [[# @LINE]]| 1|
+    int z = 0; // comment              // CHECK-NEXT:  [[# @LINE]]| 1|
+    // comment                         // CHECK-NEXT:  [[# @LINE]]|  |
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    x = 0; /*                          // CHECK-NEXT:  [[# @LINE]]| 1|
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */                                 // CHECK-NEXT:  [[# @LINE]]|  |
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    /*                                 // CHECK-NEXT:  [[# @LINE]]|  |
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */ x = 0;                          // CHECK-NEXT:  [[# @LINE]]| 1|
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    /* comment */                      // CHECK-NEXT:  [[# @LINE]]|  |
+    // comment                         // CHECK-NEXT:  [[# @LINE]]|  |
+    /* comment */                      // CHECK-NEXT:  [[# @LINE]]|  |
+    z =                                // CHECK-NEXT:  [[# @LINE]]| 1|
+    x // comment                       // CHECK-NEXT:  [[# @LINE]]| 1|
+    // comment                         // CHECK-NEXT:  [[# @LINE]]|  |
+    + /*                               // CHECK-NEXT:  [[# @LINE]]| 1|
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */                                 // CHECK-NEXT:  [[# @LINE]]|  |
+    /*                                 // CHECK-NEXT:  [[# @LINE]]|  |
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */y;                               // CHECK-NEXT:  [[# @LINE]]| 1|
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    // Comments inside directives.     // CHECK-NEXT:  [[# @LINE]]|  |
+    #if 0 //comment                    // CHECK-NEXT:  [[# @LINE]]|  |
+    /* comment */ x = 0;               // CHECK-NEXT:  [[# @LINE]]|  |
+    y = 0; /* comment */               // CHECK-NEXT:  [[# @LINE]]|  |
+    z = 0; // comment                  // CHECK-NEXT:  [[# @LINE]]|  |
+    // comment                         // CHECK-NEXT:  [[# @LINE]]|  |
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    x = 0; /*                          // CHECK-NEXT:  [[# @LINE]]|  |
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */                                 // CHECK-NEXT:  [[# @LINE]]|  |
+                                       // CHECK-NEXT:  [[# @LINE]]|  | 
+    /*                                 // CHECK-NEXT:  [[# @LINE]]|  |
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */ x = 0;                          // CHECK-NEXT:  [[# @LINE]]|  |
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    /* comment */                      // CHECK-NEXT:  [[# @LINE]]|  |
+    // comment                         // CHECK-NEXT:  [[# @LINE]]|  |
+    /* comment */                      // CHECK-NEXT:  [[# @LINE]]|  |
+    #endif // comment                  // CHECK-NEXT:  [[# @LINE]]|  |
+    #if 1 // comment                   // CHECK-NEXT:  [[# @LINE]]| 1|
+    /* comment */ x = 0;               // CHECK-NEXT:  [[# @LINE]]| 1|
+    y = 0; /* comment */               // CHECK-NEXT:  [[# @LINE]]| 1|
+    z = 0; // comment                  // CHECK-NEXT:  [[# @LINE]]| 1|
+    // comment                         // CHECK-NEXT:  [[# @LINE]]|  |
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    x = 0; /*                          // CHECK-NEXT:  [[# @LINE]]| 1|
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */                                 // CHECK-NEXT:  [[# @LINE]]|  |
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    /*                                 // CHECK-NEXT:  [[# @LINE]]|  |
+    comment                            // CHECK-NEXT:  [[# @LINE]]|  |
+    */ x = 0;                          // CHECK-NEXT:  [[# @LINE]]| 1|
+                                       // CHECK-NEXT:  [[# @LINE]]|  |
+    /* comment */                      // CHECK-NEXT:  [[# @LINE]]|  |
+    // comment                         // CHECK-NEXT:  [[# @LINE]]|  |
+    /* comment */                      // CHECK-NEXT:  [[# @LINE]]|  |
+    #endif //comment                   // CHECK-NEXT:  [[# @LINE]]| 1|
+    return 0;                          // CHECK-NEXT:  [[# @LINE]]| 1|
+}                                      // CHECK-NEXT:  [[# @LINE]]| 1|

diff  --git a/compiler-rt/test/profile/instrprof-set-file-object-merging.c b/compiler-rt/test/profile/instrprof-set-file-object-merging.c
index 0ca5f6ff9ed9..35e9becf228f 100644
--- a/compiler-rt/test/profile/instrprof-set-file-object-merging.c
+++ b/compiler-rt/test/profile/instrprof-set-file-object-merging.c
@@ -34,7 +34,7 @@ int main(int argc, const char *argv[]) {
 // CHECK:   17|      2|
 // CHECK:   18|      2|  FILE *F = fopen(argv[1], "r+b");
 // CHECK:   19|      2|  if (!F) {
-// CHECK:   20|      1|    // File might not exist, try opening with truncation
+// CHECK:   20|       |    // File might not exist, try opening with truncation
 // CHECK:   21|      1|    F = fopen(argv[1], "w+b");
 // CHECK:   22|      1|  }
 // CHECK:   23|      2|  __llvm_profile_set_file_object(F, 1);


        


More information about the llvm-commits mailing list