1# RUN: yaml2obj %s | not llvm-dwarfdump --verify - | FileCheck %s --implicit-check-not=error:
2
3# CHECK:      error: DIE has DW_AT_decl_file with an invalid file index 2 (valid values are [1-1]){{[[:space:]]}}
4# CHECK-NEXT: 0x0000001e: DW_TAG_subprogram
5# CHECK-NEXT:               DW_AT_name        ("main")
6# CHECK-NEXT:               DW_AT_low_pc      (0x0000000000001000)
7# CHECK-NEXT:               DW_AT_high_pc     (0x0000000000002000)
8# CHECK-NEXT:               DW_AT_decl_file   (0x02)
9# CHECK-NEXT:               DW_AT_call_line   (5){{[[:space:]]}}
10# CHECK-NEXT: error: DIE has DW_AT_call_file with an invalid file index 3 (valid values are [1-1]){{[[:space:]]}}
11# CHECK-NEXT: 0x00000035: DW_TAG_inlined_subroutine
12# CHECK-NEXT:               DW_AT_name        ("inline1")
13# CHECK-NEXT:               DW_AT_low_pc      (0x0000000000001100)
14# CHECK-NEXT:               DW_AT_high_pc     (0x0000000000001200)
15# CHECK-NEXT:               DW_AT_call_file   (0x03)
16# CHECK-NEXT:               DW_AT_call_line   (10){{[[:space:]]}}
17
18# CHECK:      Errors detected.
19
20--- !ELF
21FileHeader:
22  Class:   ELFCLASS64
23  Data:    ELFDATA2LSB
24  Type:    ET_EXEC
25  Machine: EM_X86_64
26DWARF:
27  debug_str:
28    - ''
29    - '/tmp/main.c'
30    - main
31    - inline1
32  debug_abbrev:
33    - Table:
34        - Code:            0x0000000000000001
35          Tag:             DW_TAG_compile_unit
36          Children:        DW_CHILDREN_yes
37          Attributes:
38            - Attribute:       DW_AT_name
39              Form:            DW_FORM_strp
40            - Attribute:       DW_AT_language
41              Form:            DW_FORM_data2
42            - Attribute:       DW_AT_low_pc
43              Form:            DW_FORM_addr
44            - Attribute:       DW_AT_stmt_list
45              Form:            DW_FORM_sec_offset
46        - Code:            0x0000000000000002
47          Tag:             DW_TAG_subprogram
48          Children:        DW_CHILDREN_yes
49          Attributes:
50            - Attribute:       DW_AT_name
51              Form:            DW_FORM_strp
52            - Attribute:       DW_AT_low_pc
53              Form:            DW_FORM_addr
54            - Attribute:       DW_AT_high_pc
55              Form:            DW_FORM_addr
56            - Attribute:       DW_AT_decl_file
57              Form:            DW_FORM_data1
58            - Attribute:       DW_AT_call_line
59              Form:            DW_FORM_data1
60        - Code:            0x0000000000000003
61          Tag:             DW_TAG_inlined_subroutine
62          Children:        DW_CHILDREN_no
63          Attributes:
64            - Attribute:       DW_AT_name
65              Form:            DW_FORM_strp
66            - Attribute:       DW_AT_low_pc
67              Form:            DW_FORM_addr
68            - Attribute:       DW_AT_high_pc
69              Form:            DW_FORM_data4
70            - Attribute:       DW_AT_call_file
71              Form:            DW_FORM_data1
72            - Attribute:       DW_AT_call_line
73              Form:            DW_FORM_data1
74  debug_info:
75    - Length:          0x0000000000000046
76      Version:         4
77      AbbrOffset:      0x0000000000000000
78      AddrSize:        8
79      Entries:
80        - AbbrCode:        0x00000001
81          Values:
82            - Value:           0x0000000000000001
83            - Value:           0x0000000000000002
84            - Value:           0x0000000000000000
85            - Value:           0x0000000000000000
86        - AbbrCode:        0x00000002
87          Values:
88            - Value:           0x000000000000000D
89            - Value:           0x0000000000001000
90            - Value:           0x0000000000002000
91            - Value:           0x0000000000000002
92            - Value:           0x0000000000000005
93        - AbbrCode:        0x00000003
94          Values:
95            - Value:           0x0000000000000012
96            - Value:           0x0000000000001100
97            - Value:           0x0000000000000100
98            - Value:           0x0000000000000003
99            - Value:           0x000000000000000A
100        - AbbrCode:        0x00000000
101          Values:          []
102        - AbbrCode:        0x00000000
103          Values:          []
104  debug_line:
105    - Length:          40
106      Version:         2
107      PrologueLength:  34
108      MinInstLength:   1
109      DefaultIsStmt:   1
110      LineBase:        251
111      LineRange:       14
112      OpcodeBase:      13
113      StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
114      IncludeDirs:
115        - '/tmp'
116      Files:
117        - Name:            main.c
118          DirIdx:          1
119          ModTime:         0
120          Length:          0
121...
122