brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 4eba1c1 Raw
29 lines · c
1/// A basic block with fork/exec* is split. .gcda is flushed immediately before2/// fork/exec* so the lines before exec* are counted once while succeeding3/// lines are not counted.4// RUN: mkdir -p %t.d && cd %t.d5// RUN: %clang --coverage %s -o %t -dumpdir ./6// RUN: test -f gcov-execlp.gcno7// RUN: rm -f gcov-execlp.gcda && %run %t8// RUN: llvm-cov gcov -t gcov-execlp.gcda | FileCheck %s --check-prefixes=CHECK,EXECLP9 10// RUN: %clang --coverage -DEXECVP %s -o %t -dumpdir ./11// RUN: rm -f gcov-execlp.gcda && %run %t12// RUN: llvm-cov gcov -t gcov-execlp.gcda | FileCheck %s --check-prefixes=CHECK,EXECVP13 14#include <unistd.h>15 16void func1(void) {}                // CHECK:          1: [[#@LINE]]:void func1(void)17void func2(void) {}                // CHECK-NEXT: #####: [[#@LINE]]:18int main(void) {                   // CHECK-NEXT:     1: [[#@LINE]]:19  func1();                         // CHECK-NEXT:     1: [[#@LINE]]:20#ifdef EXECVP21  char *argv[] = {"ls", "-l", (char *)0};22  execvp("ls", argv);              // EXECVP:         1: [[#@LINE]]:  execvp23#else24  execlp("ls", "-l", (char *)0); // EXECLP:     1: [[#@LINE]]:  execlp25#endif26  func2();                         // CHECK:      #####: [[#@LINE]]:  func227  return 0;                        // CHECK-NEXT: #####: [[#@LINE]]:28}29