Mehdi Amini | ebb3434 | 2016-09-03 21:12:33 +0000 | [diff] [blame] | 1 | ; RUN: opt -module-summary -o %t-dst.bc %s |
| 2 | ; RUN: opt -module-summary -o %t-src.bc %p/Inputs/crash_debuginfo.ll |
| 3 | ; RUN: llvm-lto -thinlto -o %t-index %t-dst.bc %t-src.bc |
| 4 | ; RUN: opt -function-import -inline -summary-file %t-index.thinlto.bc %t-dst.bc -o %t.out |
Fangrui Song | 62536fa | 2020-10-27 12:36:59 -0700 | [diff] [blame] | 5 | ; RUN: llvm-nm -U %t.out | FileCheck %s --implicit-check-not=_bar |
Mehdi Amini | ebb3434 | 2016-09-03 21:12:33 +0000 | [diff] [blame] | 6 | |
| 7 | ; Verify that we import bar and inline it. It use to crash importing due to ODR type uniquing |
Fangrui Song | 62536fa | 2020-10-27 12:36:59 -0700 | [diff] [blame] | 8 | ; CHECK: _foo |
Mehdi Amini | ebb3434 | 2016-09-03 21:12:33 +0000 | [diff] [blame] | 9 | |
| 10 | ; ModuleID = 'test/ThinLTO/X86/crash_debuginfo.ll' |
| 11 | source_filename = "test/ThinLTO/X86/crash_debuginfo.ll" |
Amy Huang | 7b1d793 | 2019-09-10 23:15:38 +0000 | [diff] [blame] | 12 | target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
Mehdi Amini | ebb3434 | 2016-09-03 21:12:33 +0000 | [diff] [blame] | 13 | target triple = "x86_64-apple-macosx10.7.0" |
| 14 | |
Mehdi Amini | ebb3434 | 2016-09-03 21:12:33 +0000 | [diff] [blame] | 15 | define void @foo(i32 %arg) { |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 16 | call void @bar(i32 %arg), !dbg !8 |
Mehdi Amini | ebb3434 | 2016-09-03 21:12:33 +0000 | [diff] [blame] | 17 | unreachable |
| 18 | } |
| 19 | |
| 20 | declare void @bar(i32) |
| 21 | |
| 22 | !llvm.dbg.cu = !{!0} |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 23 | !llvm.module.flags = !{!7} |
Mehdi Amini | ebb3434 | 2016-09-03 21:12:33 +0000 | [diff] [blame] | 24 | |
| 25 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "Apple LLVM version 8.0.0 (clang-800.0.24.1)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !2) |
| 26 | !1 = !DIFile(filename: "1.cpp", directory: "/another_dir") |
| 27 | !2 = !{!3} |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 28 | !3 = !DIGlobalVariableExpression(var: !4, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 29 | !4 = !DIGlobalVariable(name: "_", linkageName: "some_global", scope: null, file: !1, line: 20, type: !5, isLocal: true, isDefinition: true) |
| 30 | !5 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "slice_nil", file: !1, line: 13, size: 64, align: 64, elements: !6, identifier: "_ZTSN5boost6python3api9slice_nilE") |
| 31 | !6 = !{} |
| 32 | !7 = !{i32 2, !"Debug Info Version", i32 3} |
| 33 | !8 = !DILocation(line: 728, column: 71, scope: !9, inlinedAt: !16) |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 34 | !9 = distinct !DISubprogram(name: "baz", linkageName: "baz", scope: !10, file: !1, line: 726, type: !11, isLocal: false, isDefinition: true, scopeLine: 727, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !12, retainedNodes: !13) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 35 | !10 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "some_other_class", file: !1, line: 197, size: 192, align: 64, elements: !6, templateParams: !6, identifier: "some_other_class") |
| 36 | !11 = !DISubroutineType(types: !6) |
| 37 | !12 = !DISubprogram(name: "baz", linkageName: "baz", scope: !10, file: !1, line: 726, type: !11, isLocal: false, isDefinition: false, scopeLine: 726, flags: DIFlagPrototyped, isOptimized: true) |
| 38 | !13 = !{!14} |
| 39 | !14 = !DILocalVariable(name: "caster", scope: !9, file: !1, line: 728, type: !15) |
| 40 | !15 = distinct !DICompositeType(tag: DW_TAG_union_type, scope: !9, file: !1, line: 728, size: 64, align: 64, elements: !6, identifier: "someclass") |
| 41 | !16 = distinct !DILocation(line: 87, column: 9, scope: !17) |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 42 | !17 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !10, file: !1, line: 73, type: !11, isLocal: false, isDefinition: true, scopeLine: 74, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !18, retainedNodes: !6) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 43 | !18 = !DISubprogram(name: "foo", linkageName: "foo", scope: !10, file: !1, line: 83, type: !11, isLocal: false, isDefinition: false, scopeLine: 83, flags: DIFlagPrototyped, isOptimized: true) |