22 lines · c
1// REQUIRES: target={{.*(darwin|linux|aix).*}}2 3// Test when LLVM_PROFILE_FILE is set incorrectly, it should fall backs to use default.profraw without runtime error.4 5// Create & cd into a temporary directory.6// RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir7// RUN: %clang_profgen -fprofile-continuous -fcoverage-mapping -o %t.exe %s8// RUN: env LLVM_PROFILE_FILE="incorrect-profile-name%m%c%c.profraw" %run %t.exe9// RUN: ls -l | FileCheck %s10 11// CHECK: default.profraw12// CHECK-NOT: incorrect-profile-name.profraw13 14#include <stdio.h>15int f() { return 0; }16 17int main(int argc, char **argv) {18 FILE *File = fopen("default.profraw", "w");19 f();20 return 0;21}22