DebugInfo: Fix a bunch of tests that, owing to their compile_unit metadata not includ...
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 5 Aug 2014 23:57:31 +0000 (23:57 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 5 Aug 2014 23:57:31 +0000 (23:57 +0000)
commit406658c31b0061b5fd7138a4a2911eaa94c37647
treea550e244d22313787c0f2b2f118fd9976ba73ebe
parentf1ca953dc671d064b3f1af878d19bfd926ce7d0b
DebugInfo: Fix a bunch of tests that, owing to their compile_unit metadata not including a 13th field, had some subtle behavior.

Without the 13th field, the "emission kind" field defaults to 0 (which
is not equal to either of the values of the emission kind enum (1 ==
full debug info, 2 == line tables only)).

In this particular instance, the comparison with "FullDebugInfo" was
done when adding elements to the ranges list - so for these test cases
no values were added to the ranges list.

This got weirder when emitting debug_loc entries as the addresses should
be relative to the range of the CU if the CU has only one range (the
reasonable assumption is that if we're emitting debug_loc lists for a CU
that CU has at least one range - but due to the above situation, it has
zero) so the ranges were emitted relative to the start of the section
rather than relative to the start of the CU's singular range.

Fix these tests by accounting for the difference in the description of
debug_loc entries (in some cases making the test ignorant to these
differences, in others adding the extra label difference expression,
etc) or the presence/absence of high/low_pc on the CU, and add the 13th
field to their CUs to enable proper "full debug info" emission here.

In a future commit I'll fix up a bunch of other test cases that are not
so rigorously depending on this behavior, but still doing similarly
weird things due to the missing 13th field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214937 91177308-0d34-0410-b5e6-96231b3b80d8
test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
test/CodeGen/ARM/debug-info-sreg2.ll
test/CodeGen/X86/2010-05-26-DotDebugLoc.ll
test/DebugInfo/X86/dbg-value-range.ll