xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/test/profile/gcc-flag-compatibility.test (revision ef84fd3bd8895f4e6be1e38baf19e6dc3255bc64)
1*ef84fd3bSjoergRUN: mkdir -p %t.d
2*ef84fd3bSjoergRUN: %clang_profgen_gcc=%t.d/d1/d2 -o %t.d/code %S/Inputs/gcc-flag-compatibility.c
3*ef84fd3bSjoerg
4*ef84fd3bSjoerg# Test that the instrumented code writes to %t.d/d1/d2/default.profraw
5*ef84fd3bSjoergRUN: %run %t.d/code
6*ef84fd3bSjoergRUN: llvm-profdata merge -o %t.profdata %t.d/d1/d2/default.profraw
7*ef84fd3bSjoerg
8*ef84fd3bSjoerg# Test that we can override the directory and file name with LLVM_PROFILE_FILE.
9*ef84fd3bSjoergRUN: env LLVM_PROFILE_FILE=%t.d/x1/prof.raw %run %t.d/code
10*ef84fd3bSjoergRUN: llvm-profdata merge -o %t.profdata %t.d/x1/prof.raw
11*ef84fd3bSjoerg
12*ef84fd3bSjoerg# Test that we can specify a directory with -fprofile-use.
13*ef84fd3bSjoergRUN: llvm-profdata merge -o %t.d/default.profdata %t.d/x1/prof.raw
14*ef84fd3bSjoergRUN: %clang_profuse_gcc=%t.d -o %t.d/code %S/Inputs/gcc-flag-compatibility.c
15*ef84fd3bSjoerg
16*ef84fd3bSjoerg# Test that we can specify a file with -fprofile-use.
17*ef84fd3bSjoergRUN: %clang_profuse_gcc=%t.profdata -o %t.d/code %S/Inputs/gcc-flag-compatibility.c
18