This revision was automatically updated to reflect the committed changes.
Closed by commit rG74a42aedfe14: [test] Add Clang side tests for
-fdebug-info-for-profiling (authored by MaskRay).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94381/new/
https://reviews.llvm.org/D94381
Files:
clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
Index: clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
@@ -0,0 +1,21 @@
+/// Normally -g1 does not add linkageName. -fdebug-info-for-profiling adds
linkageName.
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple
-debug-info-kind=line-tables-only %s -o - | FileCheck %s --check-prefix=LINE
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple
-debug-info-kind=line-tables-only -fdebug-info-for-profiling %s -o - |
FileCheck %s
+
+// LINE: = distinct !DISubprogram(name: "foo", scope:
+
+// CHECK: = distinct !DICompileUnit({{.*}}, debugInfoForProfiling: true,
+// CHECK: = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope:
+
+/// Add a DWARF discriminators pass for PGO.
+// 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
+// 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
+
+// RUN: echo > %t.proftext
+// RUN: llvm-profdata merge %t.proftext -o %t.profdata
+// 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
+
+// NODISCR-NOT: Running pass: AddDiscriminatorsPass
+// DISCR: Running pass: AddDiscriminatorsPass on {{.*}}
+
+void foo() {}
Index: clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
@@ -0,0 +1,21 @@
+/// Normally -g1 does not add linkageName. -fdebug-info-for-profiling adds linkageName.
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only %s -o - | FileCheck %s --check-prefix=LINE
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only -fdebug-info-for-profiling %s -o - | FileCheck %s
+
+// LINE: = distinct !DISubprogram(name: "foo", scope:
+
+// CHECK: = distinct !DICompileUnit({{.*}}, debugInfoForProfiling: true,
+// CHECK: = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope:
+
+/// Add a DWARF discriminators pass for PGO.
+// 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
+// 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
+
+// RUN: echo > %t.proftext
+// RUN: llvm-profdata merge %t.proftext -o %t.profdata
+// 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
+
+// NODISCR-NOT: Running pass: AddDiscriminatorsPass
+// DISCR: Running pass: AddDiscriminatorsPass on {{.*}}
+
+void foo() {}
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits