Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[profile][test] Add -fuse-ld=bfd to make instrprof-lto-pgogen.c robust
Otherwise if 'ld' is an older system LLD (FreeBSD; or if someone adds 'ld' to point to an LLD from a different installation) which does not support the current ModuleSummaryIndex::BitCodeSummaryVersion, the test will fail. Add lit feature 'binutils_lto'. GNU ld is more common than GNU gold, so we can just require 'is_binutils_lto_supported' to additionally support GNU ld. Reviewed By: myhsu Differential Revision: https://reviews.llvm.org/D84133
- Loading branch information
Showing
4 changed files
with
30 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// REQUIRES: lto | ||
// XFAIL: msvc | ||
// REQUIRES: binutils_lto | ||
|
||
// RUN: %clang_pgogen=%t.profraw -flto %s -o %t | ||
// RUN: %clang_pgogen=%t.profraw -fuse-ld=bfd -flto %s -o %t | ||
// RUN: %run %t | ||
// RUN: llvm-profdata merge %t.profraw -o %t.profdata | ||
// RUN: llvm-profdata show %t.profdata | FileCheck %s | ||
|
||
// Testing a bug that happens when trying to generate IR | ||
// profile with BFD linker + LTO plugin | ||
/// Test that we work around https://sourceware.org/bugzilla/show_bug.cgi?id=26262 | ||
/// (as of GNU ld 2.35) which happens when trying to generate IR profile with | ||
/// BFD linker + LLVMgold.so | ||
|
||
// CHECK: Instrumentation level: IR | ||
int main() { return 0; } |