instrprof-basic.c revision 2d1fdb26e458c4ddc04155c1d421bced3ba90cd0
1// RUN: %clang_profgen -o %t -O3 %s
2// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
3// RUN: llvm-profdata merge -o %t.profdata %t.profraw
4// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
5
6int main(int argc, const char *argv[]) {
7  // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
8  if (argc)
9    return 0;
10  return 1;
11}
12// CHECK: !1 = metadata !{metadata !"branch_weights", i32 2, i32 1}
13