Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/basic-block-address-map-function-sections.ll
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

62 lines
3.1 KiB
LLVM

; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,ELF,ELF-FS
; RUN: llc < %s -mtriple=x86_64 -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,ELF,ELF-NOFS
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -function-sections -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,COFF-FS
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,COFF-NOFS
;; GNU COFF (MinGW) does not support associative COMDAT.
; RUN: not --crash llc < %s -mtriple=x86_64-w64-mingw32 -function-sections -basic-block-address-map 2>&1 | FileCheck %s --check-prefix=MINGW-ERR
; MINGW-ERR: BB address map requires associative COMDAT support for COMDAT functions
$_Z4fooTIiET_v = comdat any
define dso_local i32 @_Z3barv() {
ret i32 0
}
;; For ELF, check we add SHF_LINK_ORDER for .llvm_bb_addr_map and link it with the corresponding .text sections.
;; For COFF, it does not have SHF_LINK_ORDER like mechanism, we use function symbol to "link" them.
; ELF-FS: .section .text._Z3barv,"ax",@progbits
; COFF-FS: .section .text,"xr",one_only,_Z3barv
; CHECK-LABEL: _Z3barv:
; CHECK-NEXT: [[BAR_BEGIN:.Lfunc_begin[0-9]+]]:
; ELF-FS: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text._Z3barv{{$}}
; ELF-NOFS: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text{{$}}
; COFF-FS: .section .llvm_bb_addr_map,"drD",associative,_Z3barv,unique,0{{$}}
; COFF-NOFS: .section .llvm_bb_addr_map,"drD"{{$}}
; CHECK-NEXT: .byte 5 # version
; CHECK-NEXT: .short 0 # feature
; CHECK-NEXT: .quad [[BAR_BEGIN]] # function address
define dso_local i32 @_Z3foov() {
%1 = call i32 @_Z4fooTIiET_v()
ret i32 %1
}
; ELF-FS: .section .text._Z3foov,"ax",@progbits
; COFF-FS: .section .text,"xr",one_only,_Z3foov
; CHECK-LABEL: _Z3foov:
; CHECK-NEXT: [[FOO_BEGIN:.Lfunc_begin[0-9]+]]:
; ELF-FS: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text._Z3foov{{$}}
; ELF-NOFS: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text{{$}}
; COFF-FS: .section .llvm_bb_addr_map,"drD",associative,_Z3foov,unique,1{{$}}
; COFF-NOFS: .section .llvm_bb_addr_map,"drD"{{$}}
; CHECK-NEXT: .byte 5 # version
; CHECK-NEXT: .short 32 # feature
; CHECK-NEXT: .quad [[FOO_BEGIN]] # function address
define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
ret i32 0
}
;; Check we add .llvm_bb_addr_map section to a COMDAT group with the corresponding .text section if such a COMDAT exists.
; ELF: .section .text._Z4fooTIiET_v,"axG",@progbits,_Z4fooTIiET_v,comdat
; COFF-FS: .section .text,"xr",discard,_Z4fooTIiET_v,unique,2{{$}}
; COFF-NOFS: .section .text,"xr",discard,_Z4fooTIiET_v{{$}}
; CHECK-LABEL: _Z4fooTIiET_v:
; CHECK-NEXT: [[FOOCOMDAT_BEGIN:.Lfunc_begin[0-9]+]]:
; ELF: .section .llvm_bb_addr_map,"oG",@llvm_bb_addr_map,.text._Z4fooTIiET_v,_Z4fooTIiET_v,comdat{{$}}
; COFF-FS: .section .llvm_bb_addr_map,"drD",associative,_Z4fooTIiET_v,unique,2{{$}}
; COFF-NOFS: .section .llvm_bb_addr_map,"drD",associative,_Z4fooTIiET_v{{$}}
; CHECK-NEXT: .byte 5 # version
; CHECK-NEXT: .short 0 # feature
; CHECK-NEXT: .quad [[FOOCOMDAT_BEGIN]] # function address