summaryrefslogtreecommitdiff
path: root/test/DebugInfo/debugify-each.ll
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-05-15 00:29:27 +0000
committerVedant Kumar <vsk@apple.com>2018-05-15 00:29:27 +0000
commitb12dd1fa59bd98b79b390455124d5270fd462464 (patch)
tree9478106ca42eabf411ba8c3503fc97362bc02282 /test/DebugInfo/debugify-each.ll
parent9897943c6c53e345c92e3e21e62f7eb42507f558 (diff)
[Debugify] Add -debugify-each for testing each pass in a pipeline
This adds a -debugify-each mode to opt which, when enabled, wraps each {Module,Function}Pass in a pipeline with logic to add, check, and strip synthetic debug info for testing purposes. This mode can be used to test complex pipelines for debug info bugs, or to collect statistics about the number of debug values & locations lost throughout various stages of a pipeline. Patch by Son Tuan Vu! Differential Revision: https://reviews.llvm.org/D46525 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/DebugInfo/debugify-each.ll')
-rw-r--r--test/DebugInfo/debugify-each.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/DebugInfo/debugify-each.ll b/test/DebugInfo/debugify-each.ll
new file mode 100644
index 00000000000..569c629e115
--- /dev/null
+++ b/test/DebugInfo/debugify-each.ll
@@ -0,0 +1,24 @@
+; RUN: opt -debugify-each -O3 -S -o - < %s | FileCheck %s
+; RUN: opt -debugify-each -instrprof -sroa -sccp -S -o - < %s | FileCheck %s
+
+define void @foo() {
+ ret void
+}
+
+define void @bar() {
+ ret void
+}
+
+; Verify that the module & function (check-)debugify passes run at least twice.
+
+; CHECK-DAG: CheckModuleDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS
+
+; CHECK-DAG: CheckModuleDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS
+; CHECK-DAG: CheckFunctionDebugify: PASS