25 lines · cpp
1/// Normally -g1 does not add linkageName. -fdebug-info-for-profiling adds linkageName.2// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only %s -o - | FileCheck %s --check-prefix=LINE3// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only -fdebug-info-for-profiling %s -o - | FileCheck %s4 5// LINE: = distinct !DISubprogram(name: "foo", scope:6 7// CHECK: = distinct !DICompileUnit({{.*}}, debugInfoForProfiling: true,8// CHECK: = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope:9 10/// Add a DWARF discriminators pass for PGO.11// RUN: %clang_cc1 -emit-llvm -fdebug-pass-manager -O1 -fprofile-instrument-path=a.profdata %s -o - 2>&1 | FileCheck %s --check-prefix=NODISCR12// RUN: %clang_cc1 -emit-llvm -fdebug-pass-manager -O1 -fprofile-instrument-path=a.profdata -fdebug-info-for-profiling %s -o - 2>&1 | FileCheck %s --check-prefix=DISCR13 14// RUN: echo > %t.proftext15// RUN: llvm-profdata merge %t.proftext -o %t.profdata16// RUN: %clang_cc1 -emit-llvm -fdebug-pass-manager -O1 -fprofile-instrument-use=clang -fprofile-instrument-use-path=%t.profdata -fdebug-info-for-profiling %s -o - 2>&1 | FileCheck %s --check-prefix=DISCR17// RUN: %clang_cc1 -emit-llvm -fdebug-pass-manager -O1 -fdebug-info-for-profiling -fpseudo-probe-for-profiling %s -o - 2>&1 | FileCheck %s --check-prefix=PROBE18 19// NODISCR-NOT: Running pass: AddDiscriminatorsPass20// DISCR: Running pass: AddDiscriminatorsPass on {{.*}}21// PROBE: Running pass: AddDiscriminatorsPass on {{.*}}22// PROBE: Running pass: SampleProfileProbePass on {{.*}}23 24void foo() {}25