xref: /llvm-project/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s (revision 8d9070e040d0aa916b3b63c319eabdf3e4a5f9df)
1# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE1=0 -o %t1.o
2# RUN: not llvm-dwarfdump -debug-loclists %t1.o 2>&1 | FileCheck %s --check-prefix=ULEB -DOFFSET=0x0000000d
3
4# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE2=0 -o %t2.o
5# RUN: not llvm-dwarfdump -debug-loclists %t2.o 2>&1 | FileCheck %s --check-prefix=ULEB -DOFFSET=0x0000000e
6
7# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE3=0 -o %t3.o
8# RUN: not llvm-dwarfdump -debug-loclists %t3.o 2>&1 | FileCheck %s --check-prefix=ULEB -DOFFSET=0x0000000f
9
10# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE4=0 -o %t4.o
11# RUN: not llvm-dwarfdump -debug-loclists %t4.o 2>&1 | FileCheck %s
12
13# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE5=0 -o %t5.o
14# RUN: not llvm-dwarfdump -debug-loclists %t5.o 2>&1 | FileCheck %s
15
16# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE6=0 -o %t6.o
17# RUN: not llvm-dwarfdump -debug-loclists %t6.o 2>&1 | FileCheck %s
18
19# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE7=0 -o %t7.o
20# RUN: not llvm-dwarfdump -debug-loclists %t7.o 2>&1 | FileCheck %s --check-prefix=UNIMPL
21
22# CHECK: error: unexpected end of data
23# ULEB: error: unable to decode LEB128 at offset [[OFFSET]]: malformed uleb128, extends past end
24# UNIMPL: error: LLE of kind 47 not supported
25
26.section  .debug_loclists,"",@progbits
27  .long  .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0
28.Ldebug_loclist_table_start0:
29 .short 5                        # Version.
30 .byte 8                         # Address size.
31 .byte 0                         # Segment selector size.
32 .long 0                         # Offset entry count.
33.Lloclists_table_base0:
34.Ldebug_loc0:
35.ifdef CASE1
36  .byte  4                       # DW_LLE_offset_pair
37.endif
38.ifdef CASE2
39  .byte  4                       # DW_LLE_offset_pair
40  .uleb128 0x0                   #   starting offset
41.endif
42.ifdef CASE3
43  .byte  4                       # DW_LLE_offset_pair
44  .uleb128 0x0                   #   starting offset
45  .uleb128 0x10                  #   ending offset
46.endif
47.ifdef CASE4
48  .byte  4                       # DW_LLE_offset_pair
49  .uleb128 0x0                   #   starting offset
50  .uleb128 0x10                  #   ending offset
51  .byte  1                       # Loc expr size
52.endif
53.ifdef CASE5
54  .byte  4                       # DW_LLE_offset_pair
55  .uleb128 0x0                   #   starting offset
56  .uleb128 0x10                  #   ending offset
57  .byte  1                       # Loc expr size
58  .byte  117                     # DW_OP_breg5
59.endif
60.ifdef CASE6
61  .byte  4                       # DW_LLE_offset_pair
62  .uleb128 0x0                   #   starting offset
63  .uleb128 0x10                  #   ending offset
64  .uleb128 0xdeadbeef            # Loc expr size
65.endif
66.ifdef CASE7
67  .byte 0x47
68.endif
69
70.Ldebug_loclist_table_end0:
71
72