1 # RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o - | \
2 # RUN: llvm-dwarfdump -debug-aranges - 2>&1 | \
5 .section .debug_aranges,"",@progbits
6 # CHECK: .debug_aranges contents:
8 ## Case 1: Check that an empty set of ranges is supported.
9 .long .L1end - .L1version # Length
10 # CHECK: Address Range Header: length = 0x00000014,
13 .long 0x3456789a # Debug Info Offset
14 .byte 4 # Address Size
15 .byte 0 # Segment Selector Size
16 # CHECK-SAME: version = 0x0002,
17 # CHECK-SAME: cu_offset = 0x3456789a,
18 # CHECK-SAME: addr_size = 0x04,
19 # CHECK-SAME: seg_size = 0x00
22 .long 0, 0 # Termination tuple
26 ## Case 2: Check that the address size of 4 is supported.
27 .long .L2end - .L2version # Length
28 # CHECK: Address Range Header: length = 0x0000001c,
31 .long 0x112233 # Debug Info Offset
32 .byte 4 # Address Size
33 .byte 0 # Segment Selector Size
34 # CHECK-SAME: version = 0x0002,
35 # CHECK-SAME: cu_offset = 0x00112233,
36 # CHECK-SAME: addr_size = 0x04,
37 # CHECK-SAME: seg_size = 0x00
40 .long 0x11223344, 0x01020304 # Address and length
41 # CHECK-NEXT: [0x11223344, 0x12243648)
42 .long 0, 0 # Termination tuple
46 ## Case 3: Check that the address size of 8 is also supported.
47 .long .L3end - .L3version # Length
48 # CHECK: Address Range Header: length = 0x0000002c,
51 .long 0x112233 # Debug Info Offset
52 .byte 8 # Address Size
53 .byte 0 # Segment Selector Size
54 # CHECK-SAME: version = 0x0002,
55 # CHECK-SAME: cu_offset = 0x00112233,
56 # CHECK-SAME: addr_size = 0x08,
57 # CHECK-SAME: seg_size = 0x00
60 .quad 0x1122334455667788 # Address
61 .quad 0x0102030405060708 # Length
62 # CHECK-NEXT: [0x1122334455667788, 0x122436485a6c7e90)
63 .quad 0, 0 # Termination tuple
67 ## Case 4: Check that 64-bit DWARF format is supported.
68 .long 0xffffffff # DWARF64 mark
69 .quad .L4end - .L4version # Length
70 # CHECK: Address Range Header: length = 0x000000000000001c,
71 # CHECK-SAME: format = DWARF64,
74 .quad 0x123456789abc # Debug Info Offset
75 .byte 4 # Address Size
76 .byte 0 # Segment Selector Size
77 # CHECK-SAME: version = 0x0002,
78 # CHECK-SAME: cu_offset = 0x0000123456789abc,
79 # CHECK-SAME: addr_size = 0x04,
80 # CHECK-SAME: seg_size = 0x00
83 .long 0, 1 # Address and length
84 # CHECK-NEXT: [0x00000000, 0x00000001)
85 .long 0, 0 # Termination tuple