llvm-project/llvm/lib/CodeGen/LiveDebugValues
Jeremy Morse 0caeaff123 [LiveDebugValues][NFC] Re-land 60db26a66d, add instr-ref tests
This was landed but reverted in 5b9c2b1bea due to asan picking up a memory
leak. This is fixed in the change to InstrRefBasedImpl.cpp. Original
commit message follows:

[LiveDebugValues][NFC] Add instr-ref tests, adapt old tests

This patch adds a few tests in DebugInfo/MIR/InstrRef/ of interesting
behaviour that the instruction referencing implementation of
LiveDebugValues has. Mostly, these tests exist to ensure that if you
give the "-experimental-debug-variable-locations" command line switch,
the right implementation runs; and to ensure it behaves the same way as
the VarLoc LiveDebugValues implementation.

I've also touched roughly 30 other tests, purely to make the tests less
rigid about what output to accept. DBG_VALUE instructions are usually
printed with a trailing !debug-location indicating its scope:

  !debug-location !1234

However InstrRefBasedLDV produces new DebugLoc instances on the fly,
meaning there sometimes isn't a numbered node when they're printed,
making the output:

  !debug-location !DILocation(line: 0, blah blah)

Which causes a ton of these tests to fail. This patch removes checks for
that final part of each DBG_VALUE instruction. None of them appear to
be actually checking the scope is correct, just that it's present, so
I don't believe there's any loss in coverage here.

Differential Revision: https://reviews.llvm.org/D83054
2020-09-11 12:14:44 +01:00
..
InstrRefBasedImpl.cpp [LiveDebugValues][NFC] Re-land 60db26a66d, add instr-ref tests 2020-09-11 12:14:44 +01:00
LiveDebugValues.cpp [LiveDebugValues] Add switches for using instr-ref variable locations 2020-08-25 14:58:48 +01:00
LiveDebugValues.h [LiveDebugValues] Add instruction-referencing LDV implementation 2020-08-22 18:31:08 +01:00
VarLocBasedImpl.cpp Fix some builds after 20bb9fe565 2020-08-22 15:20:42 +01:00