summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/Mem2Reg
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-12-08 21:57:28 +0000
committerVedant Kumar <vsk@apple.com>2017-12-08 21:57:28 +0000
commit195dfd10a679ed4860200e935d1ca292d09bb64b (patch)
tree6ac22bd0aa200d8a4bff41e35822eb9430a1447d /llvm/test/Transforms/Mem2Reg
parent927604def63286a4a67d19666399af52fee74f04 (diff)
downloadbcm5719-llvm-195dfd10a679ed4860200e935d1ca292d09bb64b.tar.gz
bcm5719-llvm-195dfd10a679ed4860200e935d1ca292d09bb64b.zip
[Debugify] Add a pass to test debug info preservation
The Debugify pass synthesizes debug info for IR. It's paired with a CheckDebugify pass which determines how much of the original debug info is preserved. These passes make it easier to create targeted tests for debug info preservation. Here is the Debugify algorithm: NextLine = 1 for (Instruction &I : M) attach DebugLoc(NextLine++) to I NextVar = 1 for (Instruction &I : M) if (canAttachDebugValue(I)) attach dbg.value(NextVar++) to I The CheckDebugify pass expects contiguous ranges of DILocations and DILocalVariables. If it fails to find all of the expected debug info, it prints a specific error to stderr which can be FileChecked. This was discussed on llvm-dev in the thread: "Passes to add/validate synthetic debug info" Differential Revision: https://reviews.llvm.org/D40512 llvm-svn: 320202
Diffstat (limited to 'llvm/test/Transforms/Mem2Reg')
-rw-r--r--llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll b/llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll
index b7f39947afb..a15be3854db 100644
--- a/llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll
+++ b/llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll
@@ -1,5 +1,8 @@
; Simple sanity check testcase. Both alloca's should be eliminated.
-; RUN: opt < %s -mem2reg -S | not grep alloca
+; RUN: opt < %s -debugify -mem2reg -check-debugify -S | FileCheck %s
+
+; CHECK-NOT: alloca
+; CHECK: CheckDebugify: PASS
define double @testfunc(i32 %i, double %j) {
%I = alloca i32 ; <i32*> [#uses=4]
OpenPOWER on IntegriCloud