blob: 1d43037fd6eeabb11231b9b7fde79fdbdcf679ca [file] [log] [blame]
Pavel Labathbd546e52019-08-29 14:26:05 +00001# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE1=0 -o %t1.o
2# RUN: llvm-dwarfdump -debug-loc %t1.o 2>&1 | FileCheck %s
3
4# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE2=0 -o %t2.o
5# RUN: llvm-dwarfdump -debug-loc %t2.o 2>&1 | FileCheck %s
6
7# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE3=0 -o %t3.o
8# RUN: llvm-dwarfdump -debug-loc %t3.o 2>&1 | FileCheck %s
9
10# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE4=0 -o %t4.o
11# RUN: llvm-dwarfdump -debug-loc %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: llvm-dwarfdump -debug-loc %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: llvm-dwarfdump -debug-loc %t6.o 2>&1 | FileCheck %s
18
Pavel Labathaaff1a62019-09-24 09:31:02 +000019# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE7=0 -o %t7.o
20# RUN: llvm-dwarfdump -debug-loc %t7.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-REG
21
Pavel Labathbd546e52019-08-29 14:26:05 +000022# CHECK: error: unexpected end of data
23
Pavel Labathaaff1a62019-09-24 09:31:02 +000024# UNKNOWN-REG: [0x0000000000000000, 0x0000000000000001): DW_OP_regx 0xdeadbeef
25
Pavel Labathbd546e52019-08-29 14:26:05 +000026.section .debug_loc,"",@progbits
27.ifdef CASE1
28 .byte 1 # bogus
29.endif
30.ifdef CASE2
Pavel Labath98634c22019-09-04 11:47:20 +000031 .quad 0 # starting offset
Pavel Labathbd546e52019-08-29 14:26:05 +000032.endif
33.ifdef CASE3
Pavel Labath98634c22019-09-04 11:47:20 +000034 .quad 0 # starting offset
35 .quad 1 # ending offset
Pavel Labathbd546e52019-08-29 14:26:05 +000036.endif
37.ifdef CASE4
Pavel Labath98634c22019-09-04 11:47:20 +000038 .quad 0 # starting offset
39 .quad 1 # ending offset
Pavel Labathbd546e52019-08-29 14:26:05 +000040 .word 0 # Loc expr size
41.endif
42.ifdef CASE5
Pavel Labath98634c22019-09-04 11:47:20 +000043 .quad 0 # starting offset
44 .quad 1 # ending offset
Pavel Labathbd546e52019-08-29 14:26:05 +000045 .word 0 # Loc expr size
Pavel Labath98634c22019-09-04 11:47:20 +000046 .quad 0 # starting offset
Pavel Labathbd546e52019-08-29 14:26:05 +000047.endif
48.ifdef CASE6
Pavel Labath98634c22019-09-04 11:47:20 +000049 .quad 0 # starting offset
50 .quad 1 # ending offset
Pavel Labathbd546e52019-08-29 14:26:05 +000051 .word 0xffff # Loc expr size
52.endif
Pavel Labathaaff1a62019-09-24 09:31:02 +000053.ifdef CASE7
54 .quad 0 # starting offset
55 .quad 1 # ending offset
56 .word 2f-1f # Loc expr size
571:
58 .byte 0x90 # DW_OP_regx
59 .uleb128 0xdeadbeef
602:
61 .quad 0 # starting offset
62 .quad 0 # ending offset
63.endif
Pavel Labathbd546e52019-08-29 14:26:05 +000064
65# A minimal compile unit is needed to deduce the address size of the location
66# lists
67.section .debug_info,"",@progbits
68 .long .Lcu_end0-.Lcu_begin0 # Length of Unit
69.Lcu_begin0:
70 .short 4 # DWARF version number
71 .long 0 # Offset Into Abbrev. Section
72 .byte 8 # Address Size (in bytes)
73 .byte 0 # End Of Children Mark
74.Lcu_end0: