Oliver Stannard | cca893f | 2015-10-12 15:52:36 +0000 | [diff] [blame] | 1 | ; RUN: %llc_dwarf -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
| 2 | ; RUN: %llc_dwarf -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
| 3 | ; REQUIRES: object-emission |
| 4 | |
| 5 | ; Generated by clang -O1 -g from the following C source: |
| 6 | ; float foo(float p) { |
| 7 | ; return p; |
| 8 | ; } |
| 9 | |
| 10 | ; When using the soft-float calling convention, we have to look through a |
| 11 | ; bitcast to find the register which contains the argument. |
| 12 | |
| 13 | ; CHECK: 0x{{[0-9a-f]*}}: DW_TAG_formal_parameter |
| 14 | ; CHECK-NEXT: DW_AT_location |
| 15 | |
| 16 | target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" |
| 17 | target triple = "armv7--none-eabi" |
| 18 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 19 | define float @foo(float %p) !dbg !4 { |
Oliver Stannard | cca893f | 2015-10-12 15:52:36 +0000 | [diff] [blame] | 20 | entry: |
| 21 | tail call void @llvm.dbg.value(metadata float %p, i64 0, metadata !9, metadata !15), !dbg !16 |
| 22 | ret float %p, !dbg !18 |
| 23 | } |
| 24 | |
| 25 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) |
| 26 | |
| 27 | !llvm.dbg.cu = !{!0} |
| 28 | !llvm.module.flags = !{!10, !11} |
| 29 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 30 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
Oliver Stannard | cca893f | 2015-10-12 15:52:36 +0000 | [diff] [blame] | 31 | !1 = !DIFile(filename: "test.c", directory: "") |
| 32 | !2 = !{} |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 33 | !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !8) |
Oliver Stannard | cca893f | 2015-10-12 15:52:36 +0000 | [diff] [blame] | 34 | !5 = !DISubroutineType(types: !6) |
| 35 | !6 = !{!7, !7} |
| 36 | !7 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) |
| 37 | !8 = !{!9} |
| 38 | !9 = !DILocalVariable(name: "p", arg: 1, scope: !4, file: !1, line: 1, type: !7) |
| 39 | !10 = !{i32 2, !"Dwarf Version", i32 4} |
| 40 | !11 = !{i32 2, !"Debug Info Version", i32 3} |
| 41 | !15 = !DIExpression() |
| 42 | !16 = !DILocation(line: 1, column: 17, scope: !4) |
| 43 | !17 = !DILocation(line: 2, column: 12, scope: !4) |
| 44 | !18 = !DILocation(line: 2, column: 3, scope: !4) |