1// RUN: rm -rf %t.d
2// RUN: mkdir -p %t.d
3// RUN: cd %t.d
4// RUN: %clang_profgen -O3 %s -o %t.out
5// RUN: %run %t.out %t.d/bad.profraw
6// RUN: llvm-profdata merge -o %t.d/default.profdata %t.d/default.profraw
7// RUN: %clang_profuse=%t.d/default.profdata -o - -S -emit-llvm %s | FileCheck %s
8
9
10void __llvm_profile_set_filename(const char *);
11int main(int argc, const char *argv[]) {
12 // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
13 if (argc < 2)
14 return 1;
15 __llvm_profile_set_filename(argv[1]);
16 __llvm_profile_set_filename(0);
17 return 0;
18}
19// CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2}
20

source code of compiler-rt/test/profile/instrprof-override-filename-then-reset-default.c