|
| 1 | +; RUN: llvm-reduce %s -o %t --delta-passes=di-metadata --test FileCheck --test-arg %s --test-arg --input-file --abort-on-invalid-reduction |
| 2 | +; CHECK: , !dbg !11 |
| 3 | + |
| 4 | +;; Tests for the bug fixed in PR#108541, where the presence of null metadata |
| 5 | +;; could result in a crash. |
| 6 | + |
| 7 | +define i1 @ham() { |
| 8 | +bb: |
| 9 | + %call = call fastcc i32 @hoge() |
| 10 | + ret i1 false |
| 11 | +} |
| 12 | + |
| 13 | +define fastcc i32 @hoge() { |
| 14 | +bb: |
| 15 | + br i1 poison, label %bb1, label %bb2 |
| 16 | + |
| 17 | +bb1: ; preds = %bb |
| 18 | + br i1 false, label %bb2, label %bb2, !dbg !11 |
| 19 | + |
| 20 | +bb2: ; preds = %bb1, %bb1, %bb |
| 21 | + ret i32 0 |
| 22 | +} |
| 23 | + |
| 24 | +!llvm.dbg.cu = !{!0} |
| 25 | +!llvm.module.flags = !{!10} |
| 26 | + |
| 27 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 20.0.0git", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !2, globals: !2, imports: !3, splitDebugInlining: false, nameTableKind: None) |
| 28 | +!1 = !DIFile(filename: "108541-metadata-crash.cpp", directory: "/tmp") |
| 29 | +!2 = !{} |
| 30 | +!3 = !{!4} |
| 31 | +!4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !6, file: !7, line: 134) |
| 32 | +!5 = !DINamespace(name: "std", scope: null) |
| 33 | +!6 = !DISubprogram(name: "abort", scope: !7, file: !7, line: 730, type: !8, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagOptimized) |
| 34 | +!7 = !DIFile(filename: "108541-metadata-crash.cpp", directory: "") |
| 35 | +!8 = !DISubroutineType(types: !9) |
| 36 | +!9 = !{null} |
| 37 | +!10 = !{i32 2, !"Debug Info Version", i32 3} |
| 38 | +!11 = !DILocation(line: 26, column: 11, scope: !12) |
| 39 | +!12 = distinct !DILexicalBlock(scope: !14, file: !13, line: 26, column: 11) |
| 40 | +!13 = !DIFile(filename: "108541-metadata-crash.cpp", directory: "/tmp") |
| 41 | +!14 = distinct !DILexicalBlock(scope: !15, file: !13, line: 25, column: 5) |
| 42 | +!15 = distinct !DILexicalBlock(scope: !16, file: !13, line: 24, column: 9) |
| 43 | +!16 = distinct !DILexicalBlock(scope: !17, file: !13, line: 14, column: 3) |
| 44 | +!17 = distinct !DILexicalBlock(scope: !18, file: !13, line: 13, column: 3) |
| 45 | +!18 = distinct !DILexicalBlock(scope: !19, file: !13, line: 13, column: 3) |
| 46 | +!19 = distinct !DISubprogram(name: "hoge", linkageName: "hoge", scope: !13, file: !13, line: 10, type: !20, scopeLine: 11, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) |
| 47 | +!20 = distinct !DISubroutineType(types: !2) |
0 commit comments