Orlando Cazalet-Hyams 911207338a
[RemoveDIs][NFC] Fix rotten green C API test (#92362)
`llvm_test_dibuilder(/*NewDebugInfoMode=*/true)` isn't currently executed in 
`return llvm_test_dibuilder(false) && llvm_test_dibuilder(true);`
because `llvm_test_dibuilder` returns 0 for success.

Split the llvm-c-test flag `--test-dibuilder` into two, one for the old and
one for the new debug info format. Add another lit test for the new format.

Now that the test actually runs, it crashes using the new format with
`llvm/lib/IR/LLVMContextImpl.cpp:53:llvm::LLVMContextImpl::~LLVMContextImpl(): Assertion 'TrailingDbgRecords.empty() && "DbgRecords in blocks not cleaned"' failed. Aborted`.

Insert terminators into the blocks so that we don't leave the debug records
trailing, unattached to any instructions, which fixes that.
2024-05-16 13:16:44 +01:00
..