Test dwarf compile unit with DW_LANG_C89

This commit is contained in:
Mark Florisson 2013-01-21 12:41:49 -06:00
commit 8c6384f242
2 changed files with 20 additions and 11 deletions

View file

@ -71,11 +71,14 @@ class CompileUnitDescriptor(object):
md(self.global_vars or []),
]
# for op in operands:
# print op
node = llvm.core.MetaData.get(llvm_module, operands)
llvm.core.MetaData.add_named_operand(llvm_module, "dbg", node)
print "printing metadata compile unit..."
print node
print "---- done ----"
# print "printing metadata compile unit..."
# print node
# print "---- done ----"
return node

View file

@ -32,7 +32,11 @@ class TestDebugInfo(unittest.TestCase):
bldr = Builder.new(bb)
info = debuginfo.CompileUnitDescriptor(
_dwarf.DW_LANG_Python,
# DW_LANG_Python segfaults:
# llvm/ADT/StringRef.h:79: llvm::StringRef::StringRef(const char*):
# Assertion `Str && "StringRef cannot be built from a NULL argument"'
# _dwarf.DW_LANG_Python,
_dwarf.DW_LANG_C89,
"test_debug_info.py",
os.path.expanduser("~/"),
"my_cool_compiler",
@ -44,13 +48,15 @@ class TestDebugInfo(unittest.TestCase):
result = bldr.fmul(value, value)
bldr.ret(result)
# info.build_metadata(mod)
print mod
# modstr = str(mod)
# print modstr
# self.assertIn("my_cool_compiler", modstr)
# print mod
modstr = str(mod)
self.assertIn("my_cool_compiler", modstr)
self.assertIn("test_debug_info.py", modstr)
self.assertIn(os.path.expanduser("~/"), modstr)
self.assertIn("my_cool_compiler", modstr)
if __name__ == '__main__':
# TestDebugInfo("test_dwarf_constants").debug()
TestDebugInfo("test_debug_info_compile_unit").debug()
# unittest.main()
# TestDebugInfo("test_debug_info_compile_unit").debug()
unittest.main()