1// REQUIRES: binutils_lto
2
3// RUN: rm -rf %t.profraw
4// RUN: %clang_pgogen=%t.profraw/ -fuse-ld=bfd -flto %s -o %t
5// RUN: %run %t
6// RUN: llvm-profdata merge %t.profraw -o %t.profdata
7// RUN: llvm-profdata show %t.profdata | FileCheck %s
8
9/// Test that we work around https://sourceware.org/bugzilla/show_bug.cgi?id=26262
10/// (as of GNU ld 2.35) which happens when trying to generate IR profile with
11/// BFD linker + LLVMgold.so
12
13// CHECK: Instrumentation level: IR
14int main() { return 0; }
15

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