| 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=LINE |
| 3 |
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only -fdebug-info-for-profiling %s -o - | FileCheck %s |
| 4 |
|
| 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=NODISCR |
| 12 |
// 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=DISCR |
| 13 |
|
| 14 |
// RUN: echo > %t.proftext |
| 15 |
// RUN: llvm-profdata merge %t.proftext -o %t.profdata |
| 16 |
// 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=DISCR |
| 17 |
// 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=PROBE |
| 18 |
|
| 19 |
// NODISCR-NOT: Running pass: AddDiscriminatorsPass |
| 20 |
// DISCR: Running pass: AddDiscriminatorsPass on {{.*}} |
| 21 |
// PROBE: Running pass: AddDiscriminatorsPass on {{.*}} |
| 22 |
// PROBE: Running pass: SampleProfileProbePass on {{.*}} |
| 23 |
|
| 24 |
void foo() {} |