2017-09-12 00:59:45 +02:00
; RUN: %llc_dwarf -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-info - | FileCheck %s
; RUN: %llc_dwarf -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-info - | FileCheck %s
2015-10-12 17:52:36 +02:00
; REQUIRES: object-emission
; Generated by clang -O1 -g from the following C source:
; float foo(float p) {
; return p;
; }
; When using the soft-float calling convention, we have to look through a
; bitcast to find the register which contains the argument.
; CHECK: 0x{{[0-9a-f]*}}: DW_TAG_formal_parameter
; CHECK-NEXT: DW_AT_location
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv7--none-eabi"
2015-11-05 23:03:56 +01:00
define float @foo ( float %p ) !dbg !4 {
2015-10-12 17:52:36 +02:00
entry:
2017-07-28 22:21:02 +02:00
tail call void @llvm.dbg.value ( metadata float %p , metadata !9 , metadata !15 ) , !dbg !16
2015-10-12 17:52:36 +02:00
ret float %p , !dbg !18
}
2017-07-28 22:21:02 +02:00
declare void @llvm.dbg.value ( metadata , metadata , metadata )
2015-10-12 17:52:36 +02:00
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !10 , !11 }
2016-04-15 17:57:41 +02:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , file: !1 , producer: "clang version 3.8.0" , isOptimized: true , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !2 )
2015-10-12 17:52:36 +02:00
!1 = !DIFile ( filename: "test.c" , directory: "" )
!2 = ! { }
2016-04-15 17:57:41 +02:00
!4 = distinct !DISubprogram ( name: "foo" , scope: !1 , file: !1 , line: 1 , type: !5 , isLocal: false , isDefinition: true , scopeLine: 1 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , variables: !8 )
2015-10-12 17:52:36 +02:00
!5 = !DISubroutineType ( types: !6 )
!6 = ! { !7 , !7 }
!7 = !DIBasicType ( name: "float" , size: 32 , align: 32 , encoding: D W _ A T E _ float )
!8 = ! { !9 }
!9 = !DILocalVariable ( name: "p" , arg: 1 , scope: !4 , file: !1 , line: 1 , type: !7 )
!10 = ! { i32 2 , !"Dwarf Version" , i32 4 }
!11 = ! { i32 2 , !"Debug Info Version" , i32 3 }
!15 = !DIExpression ( )
!16 = !DILocation ( line: 1 , column: 17 , scope: !4 )
!17 = !DILocation ( line: 2 , column: 12 , scope: !4 )
!18 = !DILocation ( line: 2 , column: 3 , scope: !4 )