[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst
Vedant Kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 22 10:01:10 PDT 2018
vsk added inline comments.
================
Comment at: test/CodeGen/debug-info-preserve-scope.c:10
+
+// CHECK: alloca i32 {{.*}} !dbg ![[dbgLocForStore:[0-9]+]]
+// CHECK: store i32 {{.*}} !dbg ![[dbgLocForStore:[0-9]+]]
----------------
In these two check lines, you're capturing the variable dbgLocForStore twice. That means that if the !dbg location on the alloca were different from the location on the store, this test would still pass.
To fix that, just capture the dbgLocForStore variable once, the first time you see it on the alloca. In the second check line, you can simply refer to the captured variable with `[[dbgLocForStore]]`.
Repository:
rC Clang
https://reviews.llvm.org/D47097
More information about the cfe-commits
mailing list