]> git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / test / profile / instrprof-write-file-atexit-explicitly.c
1 // RUN: %clang_profgen -o %t -O3 %s
2 // RUN: %run %t %t.profraw
3 // RUN: llvm-profdata merge -o %t.profdata %t.profraw
4 // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
5
6 int __llvm_profile_runtime = 0;
7 int __llvm_profile_register_write_file_atexit(void);
8 void __llvm_profile_set_filename(const char *);
9 int main(int argc, const char *argv[]) {
10 __llvm_profile_register_write_file_atexit();
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 return 0;
16 }
17 // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2}