2013-12-21 19:04:03 -05:00
; RUN: llc -mtriple=x86_64-apple-darwin < %s -o -
; PR16954
;
; Make sure that when we splice off the end of a machine basic block, we include
; DBG_VALUE MI in the terminator sequence.
@a = external global { i64 , [ 56 x i8 ] } , align 32
; Function Attrs: nounwind sspreq
2015-12-30 06:46:15 -05:00
define i32 @_Z18read_response_sizev ( ) #0 !dbg !9 {
2013-12-21 19:04:03 -05:00
entry:
2015-05-27 14:44:32 -04:00
tail call void @llvm.dbg.value ( metadata !22 , i64 0 , metadata !23 , metadata !DIExpression ( ) ) , !dbg !39
%0 = load i64 , i64 * getelementptr inbounds ( { i64 , [ 56 x i8 ] } , { i64 , [ 56 x i8 ] } * @a , i32 0 , i32 0 ) , align 8 , !dbg !40
tail call void @llvm.dbg.value ( metadata i32 undef , i64 0 , metadata !64 , metadata !DIExpression ( ) ) , !dbg !71
2013-12-21 19:04:03 -05:00
%1 = trunc i64 %0 to i32
ret i32 %1
}
; Function Attrs: nounwind readnone
2015-01-18 11:17:27 -05:00
declare void @llvm.dbg.value ( metadata , i64 , metadata , metadata )
2013-12-21 19:04:03 -05:00
attributes #0 = { sspreq }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !21 , !72 }
2015-12-30 06:46:15 -05:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.4 " , isOptimized: true , emissionKind: 1 , file: !1 , enums: !2 , retainedTypes: !5 , subprograms: !8 , globals: !20 , imports: !5 )
2015-05-27 14:44:32 -04:00
!1 = !DIFile ( filename: "<unknown>" , directory: "/Users/matt/ryan_bug" )
2015-01-18 11:17:27 -05:00
!2 = ! { !3 }
2015-05-27 14:44:32 -04:00
!3 = !DICompositeType ( tag: D W _ T A G _ e n u m e r a t i o n _ type , line: 20 , size: 32 , align: 32 , file: !1 , scope: !4 , elements: !6 )
!4 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "C" , line: 19 , size: 8 , align: 8 , file: !1 , elements: !5 )
2015-01-18 11:17:27 -05:00
!5 = ! { }
!6 = ! { !7 }
2015-05-27 14:44:32 -04:00
!7 = !DIEnumerator ( name: "max_frame_size" , value: 0 ) ; [ DW_TAG_enumerator ] [max_frame_size :: 0]
2015-01-18 11:17:27 -05:00
!8 = ! { !9 , !24 , !41 , !65 }
2015-12-30 06:46:15 -05:00
!9 = distinct !DISubprogram ( name: "read_response_size" , linkageName: "_Z18read_response_sizev" , line: 27 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , scopeLine: 27 , file: !1 , scope: !10 , type: !11 , variables: !14 )
2015-05-27 14:44:32 -04:00
!10 = !DIFile ( filename: "<unknown>" , directory: "/Users/matt/ryan_bug" )
!11 = !DISubroutineType ( types: !12 )
2015-01-18 11:17:27 -05:00
!12 = ! { !13 }
2015-05-27 14:44:32 -04:00
!13 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
2015-01-18 11:17:27 -05:00
!14 = ! { !15 , !19 }
2015-12-30 06:46:15 -05:00
!15 = !DILocalVariable ( name: "b" , line: 28 , scope: !9 , file: !10 , type: !16 )
2015-05-27 14:44:32 -04:00
!16 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "B" , line: 16 , size: 32 , align: 32 , file: !1 , elements: !17 )
2015-01-18 11:17:27 -05:00
!17 = ! { !18 }
2015-05-27 14:44:32 -04:00
!18 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "end_of_file" , line: 17 , size: 32 , align: 32 , file: !1 , scope: !16 , baseType: !13 )
2015-12-30 06:46:15 -05:00
!19 = !DILocalVariable ( name: "c" , line: 29 , scope: !9 , file: !10 , type: !13 )
2015-01-18 11:17:27 -05:00
!20 = ! { }
!21 = ! { i32 2 , !"Dwarf Version" , i32 2 }
2015-05-27 14:44:32 -04:00
!22 = ! { i64 * getelementptr inbounds ( { i64 , [ 56 x i8 ] } , { i64 , [ 56 x i8 ] } * @a , i32 0 , i32 0 ) }
2015-12-30 06:46:15 -05:00
!23 = !DILocalVariable ( name: "p2" , line: 12 , arg: 2 , scope: !24 , file: !10 , type: !32 )
!24 = distinct !DISubprogram ( name: "min<unsigned long long>" , linkageName: "_ZN3__13minIyEERKT_S3_RS1_" , line: 12 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , scopeLine: 12 , file: !1 , scope: !25 , type: !27 , templateParams: !33 , variables: !35 )
2015-05-27 14:44:32 -04:00
!25 = !DINamespace ( name: "__1" , line: 1 , file: !26 , scope: null )
!26 = !DIFile ( filename: "main.cpp" , directory: "/Users/matt/ryan_bug" )
!27 = !DISubroutineType ( types: !28 )
2015-01-18 11:17:27 -05:00
!28 = ! { !29 , !29 , !32 }
2015-05-27 14:44:32 -04:00
!29 = !DIDerivedType ( tag: D W _ T A G _ r e f e r e n c e _ type , baseType: !30 )
!30 = !DIDerivedType ( tag: D W _ T A G _ c o n s t _ type , baseType: !31 )
!31 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "long long unsigned int" , size: 64 , align: 64 , encoding: D W _ A T E _ u n s i g n e d )
!32 = !DIDerivedType ( tag: D W _ T A G _ r e f e r e n c e _ type , baseType: !31 )
2015-01-18 11:17:27 -05:00
!33 = ! { !34 }
2015-05-27 14:44:32 -04:00
!34 = !DITemplateTypeParameter ( name: "_Tp" , type: !31 )
2015-01-18 11:17:27 -05:00
!35 = ! { !36 , !37 }
2015-12-30 06:46:15 -05:00
!36 = !DILocalVariable ( name: "p1" , line: 12 , arg: 1 , scope: !24 , file: !10 , type: !29 )
!37 = !DILocalVariable ( name: "p2" , line: 12 , arg: 2 , scope: !24 , file: !10 , type: !32 )
2015-05-27 14:44:32 -04:00
!38 = !DILocation ( line: 33 , scope: !9 )
!39 = !DILocation ( line: 12 , scope: !24 , inlinedAt: !38 )
!40 = !DILocation ( line: 9 , scope: !41 , inlinedAt: !59 )
2015-12-30 06:46:15 -05:00
!41 = distinct !DISubprogram ( name: "min<unsigned long long, __1::A>" , linkageName: "_ZN3__13minIyNS_1AEEERKT_S4_RS2_T0_" , line: 7 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , scopeLine: 8 , file: !1 , scope: !25 , type: !42 , templateParams: !53 , variables: !55 )
2015-05-27 14:44:32 -04:00
!42 = !DISubroutineType ( types: !43 )
2015-01-18 11:17:27 -05:00
!43 = ! { !29 , !29 , !32 , !44 }
2015-05-27 14:44:32 -04:00
!44 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "A" , size: 8 , align: 8 , file: !1 , scope: !25 , elements: !45 )
2015-01-18 11:17:27 -05:00
!45 = ! { !46 }
2015-05-27 14:44:32 -04:00
!46 = !DISubprogram ( name: "operator()" , linkageName: "_ZN3__11AclERKiS2_" , line: 1 , isLocal: false , isDefinition: false , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , scopeLine: 1 , file: !1 , scope: !44 , type: !47 )
!47 = !DISubroutineType ( types: !48 )
2015-01-18 11:17:27 -05:00
!48 = ! { !13 , !49 , !50 , !50 }
2015-05-27 14:44:32 -04:00
!49 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l | D I F l a g O b j e c t P o i n t e r , baseType: !44 )
!50 = !DIDerivedType ( tag: D W _ T A G _ r e f e r e n c e _ type , baseType: !51 )
!51 = !DIDerivedType ( tag: D W _ T A G _ c o n s t _ type , baseType: !13 )
2015-01-18 11:17:27 -05:00
!53 = ! { !34 , !54 }
2015-05-27 14:44:32 -04:00
!54 = !DITemplateTypeParameter ( name: "_Compare" , type: !44 )
2015-01-18 11:17:27 -05:00
!55 = ! { !56 , !57 , !58 }
2015-12-30 06:46:15 -05:00
!56 = !DILocalVariable ( name: "p1" , line: 7 , arg: 1 , scope: !41 , file: !10 , type: !29 )
!57 = !DILocalVariable ( name: "p2" , line: 7 , arg: 2 , scope: !41 , file: !10 , type: !32 )
!58 = !DILocalVariable ( name: "p3" , line: 8 , arg: 3 , scope: !41 , file: !10 , type: !44 )
2015-05-27 14:44:32 -04:00
!59 = !DILocation ( line: 13 , scope: !24 , inlinedAt: !38 )
2015-01-18 11:17:27 -05:00
!63 = ! { i32 undef }
2015-12-30 06:46:15 -05:00
!64 = !DILocalVariable ( name: "p1" , line: 1 , arg: 2 , scope: !65 , file: !10 , type: !50 )
!65 = distinct !DISubprogram ( name: "operator()" , linkageName: "_ZN3__11AclERKiS2_" , line: 1 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , scopeLine: 2 , file: !1 , scope: !25 , type: !47 , declaration: !46 , variables: !66 )
2015-01-18 11:17:27 -05:00
!66 = ! { !67 , !69 , !70 }
2015-12-30 06:46:15 -05:00
!67 = !DILocalVariable ( name: "this" , arg: 1 , flags: D I F l a g A r t i f i c i a l | D I F l a g O b j e c t P o i n t e r , scope: !65 , type: !68 )
2015-05-27 14:44:32 -04:00
!68 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !44 )
2015-12-30 06:46:15 -05:00
!69 = !DILocalVariable ( name: "p1" , line: 1 , arg: 2 , scope: !65 , file: !10 , type: !50 )
!70 = !DILocalVariable ( name: "" , line: 2 , arg: 3 , scope: !65 , file: !10 , type: !50 )
2015-05-27 14:44:32 -04:00
!71 = !DILocation ( line: 1 , scope: !65 , inlinedAt: !40 )
!72 = ! { i32 1 , !"Debug Info Version" , i32 3 }