2015-03-03 21:12:52 +01:00
; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump --debug-dump=info - | FileCheck %s
; CHECK: DW_TAG_variable
; DW_OP_fbreg
; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (<0x2> 91 00 )
; CHECK-NEXT: DW_AT_name {{.*}}"i"
target datalayout = "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
; Function Attrs: nounwind uwtable
declare i32 @foo ( i32 %i ) #0
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
; Function Attrs: nounwind uwtable
2015-11-05 23:03:56 +01:00
define i32 @main ( ) #0 !dbg !9 {
2015-03-03 21:12:52 +01:00
entry:
%retval = alloca i32 , align 4
%i = alloca i32 , align 4
store i32 0 , i32 * %retval
call void @llvm.dbg.declare ( metadata i32 * %i , metadata !20 , metadata !16 ) , !dbg !21
store i32 20 , i32 * %i , align 4 , !dbg !21
%0 = load i32 , i32 * %i , align 4 , !dbg !22
%call = call i32 @foo ( i32 %0 ) , !dbg !23
ret i32 %call , !dbg !24
}
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !12 , !13 }
!llvm.ident = ! { !14 }
2016-04-15 17:57:41 +02:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.7.0" , isOptimized: false , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
2015-04-29 18:38:44 +02:00
!1 = !DIFile ( filename: "x.c" , directory: "" )
2015-03-03 21:12:52 +01:00
!2 = ! { }
2016-04-15 17:57:41 +02:00
!4 = distinct !DISubprogram ( name: "foo" , line: 2 , isLocal: false , isDefinition: true , flags: D I F l a g P r o t o t y p e d , isOptimized: false , unit: !0 , scopeLine: 3 , file: !1 , scope: !5 , type: !6 , variables: !2 )
2015-04-29 18:38:44 +02:00
!5 = !DIFile ( filename: "x.c" , directory: "" )
!6 = !DISubroutineType ( types: !7 )
2015-03-03 21:12:52 +01:00
!7 = ! { !8 , !8 }
2015-04-29 18:38:44 +02:00
!8 = !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 )
2016-04-15 17:57:41 +02:00
!9 = distinct !DISubprogram ( name: "main" , line: 8 , isLocal: false , isDefinition: true , isOptimized: false , unit: !0 , scopeLine: 9 , file: !1 , scope: !5 , type: !10 , variables: !2 )
2015-04-29 18:38:44 +02:00
!10 = !DISubroutineType ( types: !11 )
2015-03-03 21:12:52 +01:00
!11 = ! { !8 }
!12 = ! { i32 2 , !"Dwarf Version" , i32 4 }
!13 = ! { i32 2 , !"Debug Info Version" , i32 3 }
!14 = ! { !"clang version 3.7.0" }
2015-07-31 20:58:39 +02:00
!15 = !DILocalVariable ( name: "i" , line: 2 , arg: 1 , scope: !4 , file: !5 , type: !8 )
2015-04-29 18:38:44 +02:00
!16 = !DIExpression ( )
!17 = !DILocation ( line: 2 , column: 10 , scope: !4 )
!18 = !DILocation ( line: 4 , column: 10 , scope: !4 )
!19 = !DILocation ( line: 4 , column: 3 , scope: !4 )
2015-07-31 20:58:39 +02:00
!20 = !DILocalVariable ( name: "i" , line: 10 , scope: !9 , file: !5 , type: !8 )
2015-04-29 18:38:44 +02:00
!21 = !DILocation ( line: 10 , column: 7 , scope: !9 )
!22 = !DILocation ( line: 11 , column: 15 , scope: !9 )
!23 = !DILocation ( line: 11 , column: 10 , scope: !9 )
!24 = !DILocation ( line: 11 , column: 3 , scope: !9 )