33 lines · c
1// Test that the specified output has profiling data.2// RUN: %clang_profgen -fcoverage-mapping -o %t %s3// RUN: %run %t %t.file.profraw4// RUN: test -f %t.file.profraw5// RUN: llvm-profdata merge -o %t.file.profdata %t.file.profraw6// RUN: llvm-cov show -instr-profile %t.file.profdata %t | FileCheck %s --match-full-lines7// RUN: rm %t.file.profraw %t.file.profdata8#include <stdio.h>9 10extern void __llvm_profile_set_file_object(FILE *, int);11 12int main(int argc, const char *argv[]) {13 if (argc < 2)14 return 1;15 16 FILE *F = fopen(argv[1], "w+b");17 __llvm_profile_set_file_object(F, 0);18 return 0;19}20// XFAIL: target={{.*}}-aix{{.*}}21// CHECK: 8| |#include <stdio.h>22// CHECK: 9| |23// CHECK: 10| |extern void __llvm_profile_set_file_object(FILE *, int);24// CHECK: 11| |25// CHECK: 12| 1|int main(int argc, const char *argv[]) {26// CHECK: 13| 1| if (argc < 2)27// CHECK: 14| 0| return 1;28// CHECK: 15| |29// CHECK: 16| 1| FILE *F = fopen(argv[1], "w+b");30// CHECK: 17| 1| __llvm_profile_set_file_object(F, 0);31// CHECK: 18| 1| return 0;32// CHECK: 19| 1|}33