blob: b250afab1ed6861a2cf85ca5af57b0ed4811a918 [file] [log] [blame]
Mehdi Aminiebb34342016-09-03 21:12:33 +00001; 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
5; RUN: llvm-nm %t.out | FileCheck %s
6
7; Verify that we import bar and inline it. It use to crash importing due to ODR type uniquing
8; CHECK-NOT: bar
9; CHECK: foo
10; CHECK-NOT: bar
11
12; ModuleID = 'test/ThinLTO/X86/crash_debuginfo.ll'
13source_filename = "test/ThinLTO/X86/crash_debuginfo.ll"
14target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
15target triple = "x86_64-apple-macosx10.7.0"
16
17%some_type = type { i32 }
18
19define void @foo(i32 %arg) {
20 call void @bar(i32 %arg), !dbg !7
21 unreachable
22}
23
24declare void @bar(i32)
25
26!llvm.dbg.cu = !{!0}
27!llvm.module.flags = !{!6}
28
29!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)
30!1 = !DIFile(filename: "1.cpp", directory: "/another_dir")
31!2 = !{!3}
32!3 = distinct !DIGlobalVariable(name: "_", linkageName: "some_global", scope: null, file: !1, line: 20, type: !4, isLocal: true, isDefinition: true, variable: %some_type* undef)
33!4 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "slice_nil", file: !1, line: 13, size: 64, align: 64, elements: !5, identifier: "_ZTSN5boost6python3api9slice_nilE")
34!5 = !{}
35!6 = !{i32 2, !"Debug Info Version", i32 3}
36!7 = distinct !DILocation(line: 728, column: 71, scope: !8, inlinedAt: !15)
37!8 = distinct !DISubprogram(name: "baz", linkageName: "baz", scope: !9, file: !1, line: 726, type: !10, isLocal: false, isDefinition: true, scopeLine: 727, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !11, variables: !12)
38!9 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "some_other_class", file: !1, line: 197, size: 192, align: 64, elements: !5, templateParams: !5, identifier: "some_other_class")
39!10 = !DISubroutineType(types: !5)
40!11 = !DISubprogram(name: "baz", linkageName: "baz", scope: !9, file: !1, line: 726, type: !10, isLocal: false, isDefinition: false, scopeLine: 726, flags: DIFlagPrototyped, isOptimized: true)
41!12 = !{!13}
42!13 = !DILocalVariable(name: "caster", scope: !8, file: !1, line: 728, type: !14)
43!14 = distinct !DICompositeType(tag: DW_TAG_union_type, scope: !8, file: !1, line: 728, size: 64, align: 64, elements: !5, identifier: "someclass")
44!15 = distinct !DILocation(line: 87, column: 9, scope: !16)
45!16 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !9, line: 73, type: !10, isLocal: false, isDefinition: true, scopeLine: 74, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !17, variables: !5)
46!17 = !DISubprogram(name: "foo", linkageName: "foo", scope: !9, file: !1, line: 83, type: !10, isLocal: false, isDefinition: false, scopeLine: 83, flags: DIFlagPrototyped, isOptimized: true)