174a42aedSFangrui Song /// Normally -g1 does not add linkageName. -fdebug-info-for-profiling adds linkageName.
274a42aedSFangrui Song // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only %s -o - | FileCheck %s --check-prefix=LINE
374a42aedSFangrui Song // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only -fdebug-info-for-profiling %s -o - | FileCheck %s
474a42aedSFangrui Song
574a42aedSFangrui Song // LINE: = distinct !DISubprogram(name: "foo", scope:
674a42aedSFangrui Song
774a42aedSFangrui Song // CHECK: = distinct !DICompileUnit({{.*}}, debugInfoForProfiling: true,
874a42aedSFangrui Song // CHECK: = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope:
974a42aedSFangrui Song
1074a42aedSFangrui Song /// Add a DWARF discriminators pass for PGO.
11*98574aa1SArthur Eubanks // RUN: %clang_cc1 -emit-llvm -fdebug-pass-manager -O1 -fprofile-instrument-path=a.profdata %s -o - 2>&1 | FileCheck %s --check-prefix=NODISCR
12*98574aa1SArthur Eubanks // 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
1374a42aedSFangrui Song
1474a42aedSFangrui Song // RUN: echo > %t.proftext
1574a42aedSFangrui Song // RUN: llvm-profdata merge %t.proftext -o %t.profdata
16*98574aa1SArthur Eubanks // RUN: %clang_cc1 -emit-llvm -fdebug-pass-manager -O1 -fprofile-instrument-use-path=%t.profdata -fdebug-info-for-profiling %s -o - 2>&1 | FileCheck %s --check-prefix=DISCR
17*98574aa1SArthur Eubanks // 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
1874a42aedSFangrui Song
1974a42aedSFangrui Song // NODISCR-NOT: Running pass: AddDiscriminatorsPass
2074a42aedSFangrui Song // DISCR: Running pass: AddDiscriminatorsPass on {{.*}}
21ccb5b9bbSHongtao Yu // PROBE: Running pass: AddDiscriminatorsPass on {{.*}}
22ccb5b9bbSHongtao Yu // PROBE: Running pass: SampleProfileProbePass on {{.*}}
2374a42aedSFangrui Song
foo()2474a42aedSFangrui Song void foo() {}
25