1*38b632c1SFangrui Song# REQUIRES: x86 2*38b632c1SFangrui Song## Test that the address range contributed by an ICF folded function is identical 3*38b632c1SFangrui Song## to that of the folded-in function. Not considering ICF may lead to an address 4*38b632c1SFangrui Song## range whose low address equals the start address of the output section. 5*38b632c1SFangrui Song 6*38b632c1SFangrui Song# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o 7*38b632c1SFangrui Song# RUN: ld.lld --gdb-index --icf=all -Ttext=0x1000 %t.o -o %t 8*38b632c1SFangrui Song# RUN: llvm-dwarfdump --gdb-index %t | FileCheck %s 9*38b632c1SFangrui Song 10*38b632c1SFangrui Song# CHECK: Address area offset = 0x38, has 2 entries: 11*38b632c1SFangrui Song# CHECK-NEXT: Low/High address = [0x1001, 0x1002) (Size: 0x1), CU id = 0 12*38b632c1SFangrui Song# CHECK-NEXT: Low/High address = [0x1001, 0x1002) (Size: 0x1), CU id = 1 13*38b632c1SFangrui Song 14*38b632c1SFangrui Song.text 15*38b632c1SFangrui Songnop 16*38b632c1SFangrui Song 17*38b632c1SFangrui Song.section .text.0,"ax" 18*38b632c1SFangrui Song.Lfunc_begin0: 19*38b632c1SFangrui Song ret 20*38b632c1SFangrui Song.Lfunc_end0: 21*38b632c1SFangrui Song 22*38b632c1SFangrui Song.section .text.1,"ax" 23*38b632c1SFangrui Song.Lfunc_begin1: 24*38b632c1SFangrui Song ret 25*38b632c1SFangrui Song.Lfunc_end1: 26*38b632c1SFangrui Song 27*38b632c1SFangrui Song.section .debug_abbrev,"",@progbits 28*38b632c1SFangrui Song .byte 1 # Abbreviation Code 29*38b632c1SFangrui Song .byte 65 # DW_TAG_type_unit 30*38b632c1SFangrui Song .byte 0 # DW_CHILDREN_no 31*38b632c1SFangrui Song .byte 0 # EOM(1) 32*38b632c1SFangrui Song .byte 0 # EOM(2) 33*38b632c1SFangrui Song 34*38b632c1SFangrui Song .byte 2 # Abbreviation Code 35*38b632c1SFangrui Song .byte 17 # DW_TAG_compile_unit 36*38b632c1SFangrui Song .byte 0 # DW_CHILDREN_no 37*38b632c1SFangrui Song .byte 17 # DW_AT_low_pc 38*38b632c1SFangrui Song .byte 1 # DW_FORM_addr 39*38b632c1SFangrui Song .byte 18 # DW_AT_high_pc 40*38b632c1SFangrui Song .byte 6 # DW_FORM_data4 41*38b632c1SFangrui Song .byte 0 # EOM(1) 42*38b632c1SFangrui Song .byte 0 # EOM(2) 43*38b632c1SFangrui Song 44*38b632c1SFangrui Song .byte 0 # EOM(3) 45*38b632c1SFangrui Song 46*38b632c1SFangrui Song.section .debug_info,"",@progbits 47*38b632c1SFangrui Song.Lcu_begin0: 48*38b632c1SFangrui Song .long .Lcu_end0-.Lcu_begin0-4 # Length of Unit 49*38b632c1SFangrui Song .short 5 # DWARF version number 50*38b632c1SFangrui Song .byte 1 # DWARF Unit Type 51*38b632c1SFangrui Song .byte 8 # Address Size 52*38b632c1SFangrui Song .long .debug_abbrev # Offset Into Abbrev. Section 53*38b632c1SFangrui Song .byte 2 # Abbrev [2] DW_TAG_compile_unit 54*38b632c1SFangrui Song .quad .Lfunc_begin0 # DW_AT_low_pc 55*38b632c1SFangrui Song .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 56*38b632c1SFangrui Song.Lcu_end0: 57*38b632c1SFangrui Song 58*38b632c1SFangrui Song.Lcu_begin1: 59*38b632c1SFangrui Song .long .Lcu_end1-.Lcu_begin1-4 # Length of Unit 60*38b632c1SFangrui Song .short 5 # DWARF version number 61*38b632c1SFangrui Song .byte 1 # DWARF Unit Type 62*38b632c1SFangrui Song .byte 8 # Address Size 63*38b632c1SFangrui Song .long .debug_abbrev # Offset Into Abbrev. Section 64*38b632c1SFangrui Song .byte 2 # Abbrev [2] DW_TAG_compile_unit 65*38b632c1SFangrui Song .quad .Lfunc_begin1 # DW_AT_low_pc 66*38b632c1SFangrui Song .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc 67*38b632c1SFangrui Song.Lcu_end1: 68