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 -fno-legacy-pass-manager -fdebug-pass-manager -O1 -fprofile-instrument-path=a.profdata %s -o - 2>&1 | FileCheck %s --check-prefix=NODISCR
12 // RUN: %clang_cc1 -emit-llvm -fno-legacy-pass-manager -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 -fno-legacy-pass-manager -fdebug-pass-manager -O1 -fprofile-instrument-use-path=%t.profdata -fdebug-info-for-profiling %s -o - 2>&1 | FileCheck %s --check-prefix=DISCR
17 
18 // NODISCR-NOT: Running pass: AddDiscriminatorsPass
19 // DISCR:       Running pass: AddDiscriminatorsPass on {{.*}}
20 
foo()21 void foo() {}
22