1# RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
2# CHECK: .debug_info contents:
3# CHECK: DW_TAG_variable
4# CHECK-NEXT: DW_AT_location [DW_FORM_data4]	([[OFS:.*]])
5# CHECK-NEXT: DW_AT_name {{.*}}"vec"
6# CHECK: .debug_loc contents:
7# CHECK: [[OFS]]: Beginning address offset: 0x0000000000000016
8# CHECK:             Ending address offset: 0x000000000000001e
9# CHECK:              Location description: 90 80 02 93 08 90 81 02 93 08
10#                                           d0, piece 0x00000008, d1, piece 0x00000008
11--- |
12  ; Generated from:
13  ; typedef float vec2 __attribute__((vector_size(16)));
14  ; vec2 v();
15  ; float f() {
16  ;   vec2 vec = v();
17  ;   return vec[0] + vec[1];
18  ; }
19
20  target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
21  target triple = "thumbv7s-apple-ios5.0.0"
22
23  define float @f() local_unnamed_addr #0 !dbg !9 {
24  entry:
25    %call = tail call <4 x float> bitcast (<4 x float> (...)* @v to <4 x float> ()*)() #0, !dbg !19
26    tail call void @llvm.dbg.value(metadata <4 x float> %call, i64 0, metadata !14, metadata !20), !dbg !21
27    %vecext = extractelement <4 x float> %call, i32 0, !dbg !22
28    %vecext1 = extractelement <4 x float> %call, i32 1, !dbg !23
29    %add = fadd float %vecext, %vecext1, !dbg !24
30    ret float %add, !dbg !25
31  }
32
33  declare arm_aapcs_vfpcc <4 x float> @v(...) local_unnamed_addr #0
34
35  declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
36
37  attributes #0 = { nounwind readnone }
38
39  !llvm.dbg.cu = !{!0}
40  !llvm.module.flags = !{!3, !4, !5, !6, !7}
41  !llvm.ident = !{!8}
42
43  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
44  !1 = !DIFile(filename: "v.c", directory: "/")
45  !2 = !{}
46  !3 = !{i32 2, !"Dwarf Version", i32 2}
47  !4 = !{i32 2, !"Debug Info Version", i32 3}
48  !5 = !{i32 1, !"wchar_size", i32 4}
49  !6 = !{i32 1, !"min_enum_size", i32 4}
50  !7 = !{i32 1, !"PIC Level", i32 2}
51  !8 = !{!"clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)"}
52  !9 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !10, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !13)
53  !10 = !DISubroutineType(types: !11)
54  !11 = !{!12}
55  !12 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
56  !13 = !{!14}
57  !14 = !DILocalVariable(name: "vec", scope: !9, file: !1, line: 4, type: !15)
58  !15 = !DIDerivedType(tag: DW_TAG_typedef, name: "vec2", file: !1, line: 1, baseType: !16)
59  !16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !12, size: 128, flags: DIFlagVector, elements: !17)
60  !17 = !{!18}
61  !18 = !DISubrange(count: 4)
62  !19 = !DILocation(line: 4, column: 13, scope: !9)
63  !20 = !DIExpression()
64  !21 = !DILocation(line: 4, column: 7, scope: !9)
65  !22 = !DILocation(line: 5, column: 9, scope: !9)
66  !23 = !DILocation(line: 5, column: 18, scope: !9)
67  !24 = !DILocation(line: 5, column: 16, scope: !9)
68  !25 = !DILocation(line: 5, column: 2, scope: !9)
69
70...
71---
72name:            f
73alignment:       1
74exposesReturnsTwice: false
75legalized:       false
76regBankSelected: false
77selected:        false
78tracksRegLiveness: true
79calleeSavedRegisters: [ '%lr', '%d8', '%d9', '%d10', '%d11', '%d12', '%d13',
80                        '%d14', '%d15', '%q4', '%q5', '%q6', '%q7', '%r4',
81                        '%r5', '%r6', '%r7', '%r8', '%r10', '%r11', '%s16',
82                        '%s17', '%s18', '%s19', '%s20', '%s21', '%s22',
83                        '%s23', '%s24', '%s25', '%s26', '%s27', '%s28',
84                        '%s29', '%s30', '%s31', '%d8_d10', '%d9_d11', '%d10_d12',
85                        '%d11_d13', '%d12_d14', '%d13_d15', '%q4_q5', '%q5_q6',
86                        '%q6_q7', '%q4_q5_q6_q7', '%r4_r5', '%r6_r7', '%r10_r11',
87                        '%d8_d9_d10', '%d9_d10_d11', '%d10_d11_d12', '%d11_d12_d13',
88                        '%d12_d13_d14', '%d13_d14_d15', '%d8_d10_d12',
89                        '%d9_d11_d13', '%d10_d12_d14', '%d11_d13_d15',
90                        '%d8_d10_d12_d14', '%d9_d11_d13_d15', '%d9_d10',
91                        '%d11_d12', '%d13_d14', '%d9_d10_d11_d12', '%d11_d12_d13_d14' ]
92frameInfo:
93  isFrameAddressTaken: false
94  isReturnAddressTaken: false
95  hasStackMap:     false
96  hasPatchPoint:   false
97  stackSize:       4
98  offsetAdjustment: 0
99  maxAlignment:    4
100  adjustsStack:    true
101  hasCalls:        true
102  maxCallFrameSize: 0
103  hasOpaqueSPAdjustment: false
104  hasVAStart:      false
105  hasMustTailInVarArgFunc: false
106stack:
107  - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '%lr' }
108body:             |
109  bb.0.entry:
110    liveins: %lr
111
112    early-clobber %sp = frame-setup t2STR_PRE killed undef %lr, %sp, -4, 14, _
113    frame-setup CFI_INSTRUCTION def_cfa_offset 4
114    frame-setup CFI_INSTRUCTION offset %lr, -4
115    tBL 14, _, @v, csr_ios, implicit-def dead %lr, implicit %sp, implicit-def %sp, implicit-def %r0, implicit-def %r1, implicit-def %r2, implicit-def %r3, debug-location !19
116    %d1 = VMOVDRR killed %r2, killed %r3, 14, _, implicit-def %q0, debug-location !19
117    %d0 = VMOVDRR killed %r0, killed %r1, 14, _, implicit killed %q0, implicit-def %q0, debug-location !19
118    DBG_VALUE debug-use %q0, debug-use _, !14, !20, debug-location !21
119    %s4 = VMOVS %s1, 14, _, implicit-def %d2, debug-location !24
120    %d0 = VADDfd %d0, killed %d2, 14, _, implicit killed %q0, debug-location !24
121    %r0 = VMOVRS %s0, 14, _, implicit killed %d0, debug-location !25
122    %lr, %sp = t2LDR_POST %sp, 4, 14, _, debug-location !25
123    tBX_RET 14, _, implicit %r0, debug-location !25
124
125...
126