1bd546e59SPavel Labath# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE1=0 -o %t1.o 2*208a11abSDavid Blaikie# RUN: not llvm-dwarfdump -debug-loc %t1.o 2>&1 | FileCheck %s 3bd546e59SPavel Labath 4bd546e59SPavel Labath# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE2=0 -o %t2.o 5*208a11abSDavid Blaikie# RUN: not llvm-dwarfdump -debug-loc %t2.o 2>&1 | FileCheck %s 6bd546e59SPavel Labath 7bd546e59SPavel Labath# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE3=0 -o %t3.o 8*208a11abSDavid Blaikie# RUN: not llvm-dwarfdump -debug-loc %t3.o 2>&1 | FileCheck %s 9bd546e59SPavel Labath 10bd546e59SPavel Labath# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE4=0 -o %t4.o 11*208a11abSDavid Blaikie# RUN: not llvm-dwarfdump -debug-loc %t4.o 2>&1 | FileCheck %s 12bd546e59SPavel Labath 13bd546e59SPavel Labath# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE5=0 -o %t5.o 14*208a11abSDavid Blaikie# RUN: not llvm-dwarfdump -debug-loc %t5.o 2>&1 | FileCheck %s 15bd546e59SPavel Labath 16bd546e59SPavel Labath# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE6=0 -o %t6.o 17*208a11abSDavid Blaikie# RUN: not llvm-dwarfdump -debug-loc %t6.o 2>&1 | FileCheck %s 18bd546e59SPavel Labath 19aaff1a63SPavel Labath# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE7=0 -o %t7.o 20aaff1a63SPavel Labath# RUN: llvm-dwarfdump -debug-loc %t7.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-REG 21aaff1a63SPavel Labath 22bd546e59SPavel Labath# CHECK: error: unexpected end of data 23bd546e59SPavel Labath 2409080939SPavel Labath# UNKNOWN-REG: (0x0000000000000000, 0x0000000000000001): DW_OP_regx 0xdeadbeef 25aaff1a63SPavel Labath 26bd546e59SPavel Labath.section .debug_loc,"",@progbits 27bd546e59SPavel Labath.ifdef CASE1 28bd546e59SPavel Labath .byte 1 # bogus 29bd546e59SPavel Labath.endif 30bd546e59SPavel Labath.ifdef CASE2 3198634c2eSPavel Labath .quad 0 # starting offset 32bd546e59SPavel Labath.endif 33bd546e59SPavel Labath.ifdef CASE3 3498634c2eSPavel Labath .quad 0 # starting offset 3598634c2eSPavel Labath .quad 1 # ending offset 36bd546e59SPavel Labath.endif 37bd546e59SPavel Labath.ifdef CASE4 3898634c2eSPavel Labath .quad 0 # starting offset 3998634c2eSPavel Labath .quad 1 # ending offset 40bd546e59SPavel Labath .word 0 # Loc expr size 41bd546e59SPavel Labath.endif 42bd546e59SPavel Labath.ifdef CASE5 4398634c2eSPavel Labath .quad 0 # starting offset 4498634c2eSPavel Labath .quad 1 # ending offset 45bd546e59SPavel Labath .word 0 # Loc expr size 4698634c2eSPavel Labath .quad 0 # starting offset 47bd546e59SPavel Labath.endif 48bd546e59SPavel Labath.ifdef CASE6 4998634c2eSPavel Labath .quad 0 # starting offset 5098634c2eSPavel Labath .quad 1 # ending offset 51bd546e59SPavel Labath .word 0xffff # Loc expr size 52bd546e59SPavel Labath.endif 53aaff1a63SPavel Labath.ifdef CASE7 54aaff1a63SPavel Labath .quad 0 # starting offset 55aaff1a63SPavel Labath .quad 1 # ending offset 56aaff1a63SPavel Labath .word 2f-1f # Loc expr size 57aaff1a63SPavel Labath1: 58aaff1a63SPavel Labath .byte 0x90 # DW_OP_regx 59aaff1a63SPavel Labath .uleb128 0xdeadbeef 60aaff1a63SPavel Labath2: 61aaff1a63SPavel Labath .quad 0 # starting offset 62aaff1a63SPavel Labath .quad 0 # ending offset 63aaff1a63SPavel Labath.endif 64bd546e59SPavel Labath 65bd546e59SPavel Labath# A minimal compile unit is needed to deduce the address size of the location 66bd546e59SPavel Labath# lists 67bd546e59SPavel Labath.section .debug_info,"",@progbits 68bd546e59SPavel Labath .long .Lcu_end0-.Lcu_begin0 # Length of Unit 69bd546e59SPavel Labath.Lcu_begin0: 70bd546e59SPavel Labath .short 4 # DWARF version number 71bd546e59SPavel Labath .long 0 # Offset Into Abbrev. Section 72bd546e59SPavel Labath .byte 8 # Address Size (in bytes) 73bd546e59SPavel Labath .byte 0 # End Of Children Mark 74bd546e59SPavel Labath.Lcu_end0: 75