Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / fdebug-info-for-profiling.cpp
blobe468a8098d7c84c70bb48f54c347a2012fba0a4c
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
5 // LINE: = distinct !DISubprogram(name: "foo", scope:
7 // CHECK: = distinct !DICompileUnit({{.*}}, debugInfoForProfiling: true,
8 // CHECK: = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope:
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
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-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
19 // NODISCR-NOT: Running pass: AddDiscriminatorsPass
20 // DISCR: Running pass: AddDiscriminatorsPass on {{.*}}
21 // PROBE: Running pass: AddDiscriminatorsPass on {{.*}}
22 // PROBE: Running pass: SampleProfileProbePass on {{.*}}
24 void foo() {}