[PATCH] D16697: Updating .debug_line section version information to match DWARF version.

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 17:11:54 PST 2016

probinson added a comment.

> I added 3 new tests debug-line-version2.ll, debug-line-version3.ll and debug-line-version4.ll. The IR is generated from one source using different options (-gdwarf-2, -gdwarf-3 and –gdwarf-4). Any idea how to merge these three tests into one?

Don't start from a .ll file?  Your code change is in MC, so it's fine to test this with llvm-mc starting from assembler source.  llvm-mc has a -dwarf-version option so you can control the version and the associated checks from the RUN line.
I see that test/MC/ELF/gen-dwarf.s does this kind of thing, for example.
And test/MC/ARM/dwarf-asm-multiple-sections.s seems to have accumulated version tests of this nature.

Comment at: lib/MC/MCDwarf.cpp:282
@@ -281,1 +281,3 @@
+  if (context.getDwarfVersion() >= 4)
+    MCOS->EmitIntValue(1, 1);
The other state-machine parameters are all pretty obvious, but a raw "1" is not, so it ought to have a comment.



More information about the llvm-commits mailing list