Skip to content

Commit 919bdf1

Browse files
committed
Disable fatal errors in the Verifier instantiated by bugpoint's crash
debugger. When bugpoint hacks at a testcase it may at one point create illegal debug info metadata that won't even pass the Verifier. A bugpoint *driver* built with assertions should not assert on it, but reject the malformed intermediate step and continue to do its job. llvm-svn: 284490
1 parent 55466e9 commit 919bdf1

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes 2>&1 | FileCheck %s
2+
; REQUIRES: loadable_module
3+
; CHECK: All DICompileUnits must be listed in llvm.dbg.cu
4+
5+
; When bugpoint hacks at this testcase it will at one point create illegal IR
6+
; that won't even pass the Verifier. A bugpoint *driver* built with assertions
7+
; should not assert on it, but reject the malformed intermediate step.
8+
define void @f() !dbg !9 { ret void }
9+
!llvm.dbg.cu = !{!0, !1, !2, !3, !4, !5}
10+
!0 = distinct !DICompileUnit(language: 12, file: !6)
11+
!1 = distinct !DICompileUnit(language: 12, file: !6)
12+
!2 = distinct !DICompileUnit(language: 12, file: !6)
13+
!3 = distinct !DICompileUnit(language: 12, file: !6)
14+
!4 = distinct !DICompileUnit(language: 12, file: !6)
15+
!5 = distinct !DICompileUnit(language: 12, file: !6)
16+
!6 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
17+
18+
!llvm.module.flags = !{!7, !8}
19+
!7 = !{i32 2, !"Dwarf Version", i32 4}
20+
!8 = !{i32 2, !"Debug Info Version", i32 3}
21+
22+
!9 = distinct !DISubprogram(unit: !0)

llvm/tools/bugpoint/CrashDebugger.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ bool ReduceCrashingInstructions::TestInsts(
733733

734734
// Verify that this is still valid.
735735
legacy::PassManager Passes;
736-
Passes.add(createVerifierPass());
736+
Passes.add(createVerifierPass(/*FatalErrors=*/false));
737737
Passes.run(*M);
738738

739739
// Try running on the hacked up program...
@@ -809,7 +809,7 @@ bool ReduceCrashingNamedMD::TestNamedMDs(std::vector<std::string> &NamedMDs) {
809809

810810
// Verify that this is still valid.
811811
legacy::PassManager Passes;
812-
Passes.add(createVerifierPass());
812+
Passes.add(createVerifierPass(/*FatalErrors=*/false));
813813
Passes.run(*M);
814814

815815
// Try running on the hacked up program...
@@ -876,7 +876,7 @@ bool ReduceCrashingNamedMDOps::TestNamedMDOps(
876876

877877
// Verify that this is still valid.
878878
legacy::PassManager Passes;
879-
Passes.add(createVerifierPass());
879+
Passes.add(createVerifierPass(/*FatalErrors=*/false));
880880
Passes.run(*M);
881881

882882
// Try running on the hacked up program...

0 commit comments

Comments
 (0)