summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-06-28 18:58:30 +0000
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-06-28 18:58:30 +0000
commit425df22ee30b110815813cf9ad82fe087f3a0375 (patch)
tree67ed98924adb1a3e2a7de79791a5e5c742938e99 /llvm/test
parentbc78b621694e725510f44319120bcb3bd87bf6dd (diff)
downloadbcm5719-llvm-425df22ee30b110815813cf9ad82fe087f3a0375.tar.gz
bcm5719-llvm-425df22ee30b110815813cf9ad82fe087f3a0375.zip
[SROA] Preserve DebugLoc when rewriting alloca partitions
When rewriting an alloca partition copy the DL from the old alloca over the the new one. Differential Revision: https://reviews.llvm.org/D48640 llvm-svn: 335904
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/SROA/alignment.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SROA/alignment.ll b/llvm/test/Transforms/SROA/alignment.ll
index dd0661374fd..8bc90181246 100644
--- a/llvm/test/Transforms/SROA/alignment.ll
+++ b/llvm/test/Transforms/SROA/alignment.ll
@@ -1,4 +1,6 @@
; RUN: opt < %s -sroa -S | FileCheck %s
+; RUN: opt -debugify -sroa -S < %s | FileCheck %s -check-prefix DEBUGLOC
+
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n8:16:32:64"
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1)
@@ -35,6 +37,13 @@ define void @test2() {
; CHECK: store i8 42, i8* %{{.*}}
; CHECK: ret void
+; Check that when sroa rewrites the alloca partition
+; it preserves the original DebugLocation.
+; DEBUGLOC-LABEL: @test2(
+; DEBUGLOC: {{.*}} = alloca {{.*}} !dbg ![[DbgLoc:[0-9]+]]
+;
+; DEBUGLOC: ![[DbgLoc]] = !DILocation(
+
entry:
%a = alloca { i8, i8, i8, i8 }, align 2
%gep1 = getelementptr { i8, i8, i8, i8 }, { i8, i8, i8, i8 }* %a, i32 0, i32 1
OpenPOWER on IntegriCloud