1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3# RUN: ld.lld --gdb-index -e main %t.o -o /dev/null 2>&1 | FileCheck %s
4# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/gdb-index-invalid-ranges.obj.s -o %t2.o
5# RUN: llvm-ar rc %t.a %t.o
6# RUN: ld.lld --gdb-index -e main %t2.o %t.a -o /dev/null 2>&1 | FileCheck --check-prefix=ARCHIVE %s
7
8# CHECK: ld.lld: warning: {{.*}}gdb-index-invalid-ranges.s.tmp.o:{{(\(\.debug_info\):)?}} decoding address ranges: invalid range list entry at offset 0x10
9# ARCHIVE: ld.lld: warning: {{.*}}gdb-index-invalid-ranges.s.tmp.a(gdb-index-invalid-ranges.s.tmp.o):{{(\(\.debug_info\):)?}} decoding address ranges: invalid range list entry at offset 0x10
10
11.section .text.foo1,"ax",@progbits
12.globl f1
13.Lfunc_begin0:
14f1:
15 nop
16.Lfunc_end0:
17
18.section .debug_abbrev,"",@progbits
19.byte 1                       # Abbreviation Code
20.byte 17                      # DW_TAG_compile_unit
21.byte 0                       # DW_CHILDREN_no
22.byte 85                      # DW_AT_ranges
23.byte 23                      # DW_FORM_sec_offset
24.byte 0                       # EOM(1)
25.byte 0                       # EOM(2)
26.byte 0                       # EOM(3)
27
28.section .debug_info,"",@progbits
29.Lcu_begin0:
30.long .Lunit_end0-.Lunit_begin0 # Length of Unit
31.Lunit_begin0:
32.short 4                      # DWARF version number
33.long .debug_abbrev           # Offset Into Abbrev. Section
34.byte 8                       # Address Size (in bytes)
35.byte 1                       # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
36.long .Ldebug_ranges0         # DW_AT_ranges
37.Lunit_end0:
38
39.section .debug_ranges,"",@progbits
40.Ldebug_ranges0:
41.quad .Lfunc_begin0
42.quad .Lfunc_end0
43