Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 1 | # 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 Labath | aaff1a6 | 2019-09-24 09:31:02 +0000 | [diff] [blame] | 19 | # 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 Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 22 | # CHECK: error: unexpected end of data |
| 23 | |
Pavel Labath | aaff1a6 | 2019-09-24 09:31:02 +0000 | [diff] [blame] | 24 | # UNKNOWN-REG: [0x0000000000000000, 0x0000000000000001): DW_OP_regx 0xdeadbeef |
| 25 | |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 26 | .section .debug_loc,"",@progbits |
| 27 | .ifdef CASE1 |
| 28 | .byte 1 # bogus |
| 29 | .endif |
| 30 | .ifdef CASE2 |
Pavel Labath | 98634c2 | 2019-09-04 11:47:20 +0000 | [diff] [blame] | 31 | .quad 0 # starting offset |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 32 | .endif |
| 33 | .ifdef CASE3 |
Pavel Labath | 98634c2 | 2019-09-04 11:47:20 +0000 | [diff] [blame] | 34 | .quad 0 # starting offset |
| 35 | .quad 1 # ending offset |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 36 | .endif |
| 37 | .ifdef CASE4 |
Pavel Labath | 98634c2 | 2019-09-04 11:47:20 +0000 | [diff] [blame] | 38 | .quad 0 # starting offset |
| 39 | .quad 1 # ending offset |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 40 | .word 0 # Loc expr size |
| 41 | .endif |
| 42 | .ifdef CASE5 |
Pavel Labath | 98634c2 | 2019-09-04 11:47:20 +0000 | [diff] [blame] | 43 | .quad 0 # starting offset |
| 44 | .quad 1 # ending offset |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 45 | .word 0 # Loc expr size |
Pavel Labath | 98634c2 | 2019-09-04 11:47:20 +0000 | [diff] [blame] | 46 | .quad 0 # starting offset |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 47 | .endif |
| 48 | .ifdef CASE6 |
Pavel Labath | 98634c2 | 2019-09-04 11:47:20 +0000 | [diff] [blame] | 49 | .quad 0 # starting offset |
| 50 | .quad 1 # ending offset |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 51 | .word 0xffff # Loc expr size |
| 52 | .endif |
Pavel Labath | aaff1a6 | 2019-09-24 09:31:02 +0000 | [diff] [blame] | 53 | .ifdef CASE7 |
| 54 | .quad 0 # starting offset |
| 55 | .quad 1 # ending offset |
| 56 | .word 2f-1f # Loc expr size |
| 57 | 1: |
| 58 | .byte 0x90 # DW_OP_regx |
| 59 | .uleb128 0xdeadbeef |
| 60 | 2: |
| 61 | .quad 0 # starting offset |
| 62 | .quad 0 # ending offset |
| 63 | .endif |
Pavel Labath | bd546e5 | 2019-08-29 14:26:05 +0000 | [diff] [blame] | 64 | |
| 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: |