]> git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/profile/instrprof-set-filename-then-reset-default.c
New upstream version 1.20.0+dfsg1
[rustc.git] / src / libcompiler_builtins / compiler-rt / test / profile / instrprof-set-filename-then-reset-default.c
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 void __llvm_profile_set_filename(const char *);
10 int main(int argc, const char *argv[]) {
11 // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
12 if (argc < 2)
13 return 1;
14 __llvm_profile_set_filename(argv[1]);
15 __llvm_profile_set_filename(0);
16 return 0;
17 }
18 // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2}