2016-09-04 05:12:33 +08:00
; RUN: opt -module-summary -o %t-dst.bc %s
; RUN: opt -module-summary -o %t-src.bc %p/Inputs/crash_debuginfo.ll
; RUN: llvm-lto -thinlto -o %t-index %t-dst.bc %t-src.bc
; RUN: opt -function-import -inline -summary-file %t-index.thinlto.bc %t-dst.bc -o %t.out
; RUN: llvm-nm %t.out | FileCheck %s
; Verify that we import bar and inline it. It use to crash importing due to ODR type uniquing
; CHECK-NOT: bar
; CHECK: foo
; CHECK-NOT: bar
; ModuleID = 'test/ThinLTO/X86/crash_debuginfo.ll'
source_filename = "test/ThinLTO/X86/crash_debuginfo.ll"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.7.0"
define void @foo ( i32 %arg ) {
2016-12-22 08:45:21 +08:00
call void @bar ( i32 %arg ) , !dbg !8
2016-09-04 05:12:33 +08:00
unreachable
}
declare void @bar ( i32 )
!llvm.dbg.cu = ! { !0 }
2016-12-22 08:45:21 +08:00
!llvm.module.flags = ! { !7 }
2016-09-04 05:12:33 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , file: !1 , producer: "Apple LLVM version 8.0.0 (clang-800.0.24.1)" , isOptimized: true , runtimeVersion: 0 , emissionKind: F u l l D e b u g , globals: !2 )
!1 = !DIFile ( filename: "1.cpp" , directory: "/another_dir" )
!2 = ! { !3 }
2017-08-31 02:06:51 +08:00
!3 = !DIGlobalVariableExpression ( var: !4 , expr: !DIExpression ( ) )
2016-12-22 08:45:21 +08:00
!4 = !DIGlobalVariable ( name: "_" , linkageName: "some_global" , scope: null , file: !1 , line: 20 , type: !5 , isLocal: true , isDefinition: true )
!5 = distinct !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "slice_nil" , file: !1 , line: 13 , size: 64 , align: 64 , elements: !6 , identifier: "_ZTSN5boost6python3api9slice_nilE" )
!6 = ! { }
!7 = ! { i32 2 , !"Debug Info Version" , i32 3 }
!8 = !DILocation ( line: 728 , column: 71 , scope: !9 , inlinedAt: !16 )
!9 = distinct !DISubprogram ( name: "baz" , linkageName: "baz" , scope: !10 , file: !1 , line: 726 , type: !11 , isLocal: false , isDefinition: true , scopeLine: 727 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , declaration: !12 , variables: !13 )
!10 = distinct !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "some_other_class" , file: !1 , line: 197 , size: 192 , align: 64 , elements: !6 , templateParams: !6 , identifier: "some_other_class" )
!11 = !DISubroutineType ( types: !6 )
!12 = !DISubprogram ( name: "baz" , linkageName: "baz" , scope: !10 , file: !1 , line: 726 , type: !11 , isLocal: false , isDefinition: false , scopeLine: 726 , flags: D I F l a g P r o t o t y p e d , isOptimized: true )
!13 = ! { !14 }
!14 = !DILocalVariable ( name: "caster" , scope: !9 , file: !1 , line: 728 , type: !15 )
!15 = distinct !DICompositeType ( tag: D W _ T A G _ u n i o n _ type , scope: !9 , file: !1 , line: 728 , size: 64 , align: 64 , elements: !6 , identifier: "someclass" )
!16 = distinct !DILocation ( line: 87 , column: 9 , scope: !17 )
2017-02-18 07:57:42 +08:00
!17 = distinct !DISubprogram ( name: "foo" , linkageName: "foo" , scope: !10 , file: !1 , line: 73 , type: !11 , isLocal: false , isDefinition: true , scopeLine: 74 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , declaration: !18 , variables: !6 )
2016-12-22 08:45:21 +08:00
!18 = !DISubprogram ( name: "foo" , linkageName: "foo" , scope: !10 , file: !1 , line: 83 , type: !11 , isLocal: false , isDefinition: false , scopeLine: 83 , flags: D I F l a g P r o t o t y p e d , isOptimized: true )