33 lines · plain
1; REQUIRES: x86-registered-target2 3; RUN: opt -passes='thinlto-pre-link<O2>' --cs-profilegen-file=alloc -cspgo-kind=cspgo-instr-gen-pipeline -module-summary %s -o %t.bc4; RUN: llvm-dis %t.bc -o - | FileCheck %s --check-prefix=IRPGOPRE5 6;; Symbol __llvm_profile_filename and __llvm_profile_raw_version are non-prevailing here.7; RUN: llvm-lto2 run -lto-cspgo-profile-file=alloc -lto-cspgo-gen -save-temps -o %t %t.bc \8; RUN: -r=%t.bc,f,px \9; RUN: -r=%t.bc,__llvm_profile_filename,x \10; RUN: -r=%t.bc,__llvm_profile_raw_version,x11; RUN: llvm-dis %t.0.0.preopt.bc -o - | FileCheck %s --check-prefix=IRPGOBE12 13;; Before LTO, we should have the __llvm_profile_raw_version definition.14; IRPGOPRE: @__llvm_profile_raw_version = hidden constant i6415 16;; Non-prevailing __llvm_profile_raw_version is discarded by LTO. Ensure the17;; declaration is retained.18; IRPGOBE: @__llvm_profile_raw_version = external hidden constant i6419 20target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"21target triple = "x86_64-unknown-linux-gnu"22 23$f = comdat any24 25; Function Attrs: nofree norecurse nosync nounwind readnone uwtable willreturn mustprogress26define i32 @f() {27entry:28 ret i32 129}30 31!llvm.module.flags = !{!0}32!0 = !{i32 1, !"ThinLTO", i32 0}33