[IR/Verifier] List the CU we weren't able to find in llvm.dbg.cu.

llvm-svn: 295678
This commit is contained in:
Davide Italiano 2017-02-20 22:51:42 +00:00
parent 78cbd28102
commit a9de0109b3
3 changed files with 5 additions and 6 deletions

View File

@ -4421,10 +4421,8 @@ void Verifier::verifyCompileUnits() {
SmallPtrSet<const Metadata *, 2> Listed;
if (CUs)
Listed.insert(CUs->op_begin(), CUs->op_end());
AssertDI(
all_of(CUVisited,
[&Listed](const Metadata *CU) { return Listed.count(CU); }),
"All DICompileUnits must be listed in llvm.dbg.cu");
for (auto *CU : CUVisited)
AssertDI(Listed.count(CU), "DICompileUnit not listed in llvm.dbg.cu", CU);
CUVisited.clear();
}

View File

@ -1,6 +1,6 @@
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes 2>&1 | FileCheck %s
; REQUIRES: loadable_module
; CHECK: All DICompileUnits must be listed in llvm.dbg.cu
; CHECK: DICompileUnit not listed in llvm.dbg.cu
; When bugpoint hacks at this testcase it will at one point create illegal IR
; that won't even pass the Verifier. A bugpoint *driver* built with assertions

View File

@ -1,6 +1,7 @@
; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
; CHECK: assembly parsed, but does not verify
; CHECK-NEXT: All DICompileUnits must be listed in llvm.dbg.cu
; CHECK-NEXT: DICompileUnit not listed in llvm.dbg.cu
; CHECK-NEXT: !0 = distinct !DICompileUnit(language: DW_LANG_Fortran77, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
!named = !{!1}
!llvm.module.flags = !{!0}