1// RUN: %clang_profgen -o %t -O3 %s
2// RUN: env LLVM_PROFILE_FILE=%h.%t-%h.profraw_%h %run %t
3// RUN: %run uname -n > %t.n
4// RUN: llvm-profdata merge -o %t.profdata `cat %t.n`.%t-`cat %t.n`.profraw_`cat %t.n`
5// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
6// REQUIRES: shell
7
8int main(int argc, const char *argv[]) {
9 // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
10 if (argc > 2)
11 return 1;
12 return 0;
13}
14// CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2}
15

source code of compiler-rt/test/profile/instrprof-hostname.c