104 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o3# RUN: not ld.lld %t.o %t.o -o /dev/null 2>&1 | FileCheck %s4 5## Check we are able to report errors even if DW_AT_decl_file6## contains invalid file name index.7## We did not try to support this intentionally but have8## an error handling and reporting logic that can take care9## of that and hence needs a test. 10 11# CHECK: duplicate symbol: foo12# CHECK-NEXT: >>> defined at {{.*}}.o:(foo)13# CHECK-NEXT: >>> {{.*}}.o:(.bss+0x0)14 15# Used modified output from the following code and gcc 7.1.0:16# Source (1.c):17# int foo = 0;18# Invocation: g++ -g -S 1.c19 20.bss21.globl foo22.type foo, @object23.size foo, 424foo:25 26.text27.file 1 "1.c"28 29.section .debug_info,"",@progbits30 .long 0x35 # Compile Unit: length = 0x0000004b)31 .value 0x4 # version = 0x000432 .long 0 # abbr_offset = 0x033 .byte 0x8 # addr_size = 0x0834 35 .uleb128 0x1 # DW_TAG_compile_unit [1] *36 .long 0 # DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = )37 .byte 0x4 # DW_AT_language [DW_FORM_data1] (DW_LANG_C_plus_plus)38 .string "1.c" # DW_AT_name [DW_FORM_string] ("1.c")39 .long 0 # DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000000] = )40 .long 0 # DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)41 42 .uleb128 0x2 # DW_TAG_variable [2]43 .string "foo" # DW_AT_name [DW_FORM_string] ("foo")44 .byte 0xFE # DW_AT_decl_file [DW_FORM_data1] <broken file>45 .byte 0x1 # DW_AT_decl_line [DW_FORM_data1] (1)46 .long 0x32 # DW_AT_type [DW_FORM_ref4] (cu + 0x0032 => {0x00000032})47 .uleb128 0x9 # DW_AT_external [DW_FORM_flag_present] (true)48 .byte 0x349 .quad foo # DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x0)50 51 .uleb128 0x3 # DW_TAG_base_type [3]52 .byte 0x4 # DW_AT_byte_size [DW_FORM_data1] (0x04)53 .byte 0x5 # DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)54 .string "int" # DW_AT_name [DW_FORM_string] ("int")55 56.section .debug_abbrev,"",@progbits57 .uleb128 0x1 # Abbreviation code.58 .uleb128 0x11 # DW_TAG_compile_unit59 60 .byte 0x1 # ID61 .uleb128 0x25 # DW_AT_producer, DW_FORM_strp62 .uleb128 0xe63 .uleb128 0x13 # DW_AT_language, DW_FORM_data164 .uleb128 0xb65 .uleb128 0x3 # DW_AT_name, DW_FORM_string66 .uleb128 0x867 .uleb128 0x1b # DW_AT_comp_dir, DW_FORM_strp68 .uleb128 0xe69 .uleb128 0x10 # DW_AT_stmt_list, DW_FORM_sec_offset70 .uleb128 0x1771 .byte 072 .byte 073 74 .uleb128 0x2 # ID75 .uleb128 0x34 # DW_TAG_variable, DW_CHILDREN_no76 .byte 077 .uleb128 0x3 # DW_AT_name, DW_FORM_string78 .uleb128 0x879 .uleb128 0x3a # DW_AT_decl_file, DW_FORM_data180 .uleb128 0xb81 .uleb128 0x3b # DW_AT_decl_line, DW_FORM_data182 .uleb128 0xb83 .uleb128 0x49 # DW_AT_type, DW_FORM_ref484 .uleb128 0x1385 .uleb128 0x3f # DW_AT_external, DW_FORM_flag_present86 .uleb128 0x1987 .uleb128 0x2 # DW_AT_location, DW_FORM_exprloc88 .uleb128 0x1889 .byte 090 .byte 091 92 .uleb128 0x3 # ID93 .uleb128 0x24 # DW_TAG_base_type, DW_CHILDREN_no94 .byte 095 .uleb128 0xb # DW_AT_byte_size, DW_FORM_data196 .uleb128 0xb97 .uleb128 0x3e # DW_AT_encoding, DW_FORM_data198 .uleb128 0xb99 .uleb128 0x3 # DW_AT_name, DW_FORM_string100 .uleb128 0x8101 .byte 0102 .byte 0103 .byte 0104