brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · f0e1af3 Raw
28 lines · c
1/// Test we close file handle on flush, so the .gcda file can be deleted on2/// Windows while the process is still running. In addition, test we create3/// a new .gcda on flush, so there is a file when the process exists.4// RUN: mkdir -p %t.d && cd %t.d5// RUN: %clang --coverage -o %t %s -dumpdir ./6// RUN: test -f gcov-dump-and-remove.gcno7 8// RUN: rm -f gcov-dump-and-remove.gcda && %run %t9// RUN: llvm-cov gcov -t gcov-dump-and-remove.gcda | FileCheck %s10 11extern void __gcov_dump(void);12extern void __gcov_reset(void);13extern int remove(const char *);   // CHECK:          -: [[#@LINE]]:extern int remove14int main(void) {                   // CHECK-NEXT:     1: [[#@LINE]]:15  __gcov_dump();                   // CHECK-NEXT:     1: [[#@LINE]]:16  __gcov_reset();                  // CHECK-NEXT:     1: [[#@LINE]]:17  if (remove("gcov-dump-and-remove.gcda") != 0) // CHECK-NEXT:     1: [[#@LINE]]:18    return 1;                      // CHECK-NEXT: #####: [[#@LINE]]: return 1;19                                   // CHECK-NEXT:     -: [[#@LINE]]:20  __gcov_dump();                   // CHECK-NEXT:     1: [[#@LINE]]:21  __gcov_reset();                  // CHECK-NEXT:     1: [[#@LINE]]:22  __gcov_dump();                   // CHECK-NEXT:     1: [[#@LINE]]:23  if (remove("gcov-dump-and-remove.gcda") != 0) // CHECK-NEXT:     1: [[#@LINE]]:24    return 1;                      // CHECK-NEXT: #####: [[#@LINE]]: return 1;25 26  return 0;27}28