xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_cu_ref.yaml (revision 09f43c107fc7688639346d3beead72472cdadbdb)
1# RUN: yaml2obj %s -o %t.o
2# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
3
4#      CHECK: Verifying non-dwo Units...
5# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
6# CHECK-NEXT: error: DW_FORM_ref4 CU offset 0x00001234 is invalid (must be less than CU size of 0x0000001a):
7
8--- !ELF
9FileHeader:
10  Class: ELFCLASS64
11  Data:  ELFDATA2LSB
12  Type:  ET_EXEC
13DWARF:
14  debug_str:
15    - ''
16    - /tmp/main.c
17    - main
18  debug_abbrev:
19    - Table:
20        - Code:            0x00000001
21          Tag:             DW_TAG_compile_unit
22          Children:        DW_CHILDREN_yes
23          Attributes:
24            - Attribute:       DW_AT_name
25              Form:            DW_FORM_strp
26        - Code:            0x00000002
27          Tag:             DW_TAG_subprogram
28          Children:        DW_CHILDREN_no
29          Attributes:
30            - Attribute:       DW_AT_name
31              Form:            DW_FORM_strp
32            - Attribute:       DW_AT_type
33              Form:            DW_FORM_ref4
34  debug_info:
35    - Version:         4
36      AddrSize:        8
37      Entries:
38        - AbbrCode:        0x00000001
39          Values:
40            - Value:           0x0000000000000001
41        - AbbrCode:        0x00000002
42          Values:
43            - Value:           0x000000000000000D
44            - Value:           0x0000000000001234
45        - AbbrCode:        0x00000000
46