Files
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

103 lines
3.3 KiB
LLVM

; RUN: llc -function-sections -mtriple=x86_64-windows-itanium < %s | FileCheck %s
; RUN: llc -function-sections -mtriple=x86_64-windows-msvc < %s | FileCheck %s
; RUN: llc -function-sections -mtriple=x86_64-w64-windows-gnu < %s | FileCheck %s --check-prefix=GNU
; RUN: llc -function-sections -mtriple=x86_64-pc-cygwin < %s | FileCheck %s --check-prefix=GNU
; RUN: llc -function-sections -mtriple=i686-w64-windows-gnu < %s | FileCheck %s --check-prefix=GNU32
; RUN: llc -function-sections -mtriple=i686-pc-cygwin < %s | FileCheck %s --check-prefix=GNU32
; RUN: llc -function-sections -mtriple=x86_64-w64-windows-gnu < %s -filetype=obj | llvm-objdump - --headers | FileCheck %s --check-prefix=GNUOBJ
; RUN: llc -function-sections -mtriple=x86_64-pc-cygwin < %s -filetype=obj | llvm-objdump - --headers | FileCheck %s --check-prefix=GNUOBJ
; GCC and MSVC handle comdats completely differently. Make sure we do the right
; thing for each.
; Modeled on this C++ source, with additional modifications for
; -ffunction-sections:
; int bar(int);
; __declspec(selectany) int gv = 42;
; inline int foo(int x) { return bar(x) + gv; }
; int main() { return foo(1); }
$_Z3fooi = comdat any
$gv = comdat any
@gv = weak_odr dso_local global i32 42, comdat, align 4
; Function Attrs: norecurse uwtable
define dso_local i32 @main() #0 {
entry:
%call = tail call i32 @_Z3fooi(i32 1)
ret i32 %call
}
; CHECK: .section .text,"xr",one_only,main,unique,0
; CHECK: main:
; GNU: .section .text$main,"xr",one_only,main,unique,0
; GNU: main:
; GNU32: .section .text$main,"xr",one_only,_main,unique,0
; GNU32: _main:
define dso_local x86_fastcallcc i32 @fastcall(i32 %x, i32 %y) {
%rv = add i32 %x, %y
ret i32 %rv
}
; CHECK: .section .text,"xr",one_only,fastcall,unique,1
; CHECK: fastcall:
; GNU: .section .text$fastcall,"xr",one_only,fastcall,unique,1
; GNU: fastcall:
; GNU32: .section .text$fastcall,"xr",one_only,@fastcall@8,unique,1
; GNU32: @fastcall@8:
; Function Attrs: inlinehint uwtable
define linkonce_odr dso_local i32 @_Z3fooi(i32 %x) #1 comdat {
entry:
%call = tail call i32 @_Z3bari(i32 %x)
%0 = load i32, ptr @gv, align 4
%add = add nsw i32 %0, %call
ret i32 %add
}
; CHECK: .section .text,"xr",discard,_Z3fooi,unique,2
; CHECK: _Z3fooi:
; CHECK: .section .data,"dw",discard,gv
; CHECK: gv:
; CHECK: .long 42
; GNU: .section .text$_Z3fooi,"xr",discard,_Z3fooi,unique,2
; GNU: _Z3fooi:
; GNU: .section .data$gv,"dw",discard,gv
; GNU: gv:
; GNU: .long 42
; GNU32: .section .text$_Z3fooi,"xr",discard,__Z3fooi,unique,2
; GNU32: __Z3fooi:
; GNU32: .section .data$gv,"dw",discard,_gv
; GNU32: _gv:
; GNU32: .long 42
define linkonce_odr dso_local i32 @_Z3fooj(i32 %x) !section_prefix !0 {
entry:
%call = tail call i32 @_Z3bari(i32 %x)
%0 = load i32, ptr @gv, align 4
%add = add nsw i32 %0, %call
ret i32 %add
}
; Make sure the assembler puts the .xdata and .pdata in sections with the right
; names.
; GNUOBJ: .text$_Z3fooi
; GNUOBJ: .xdata$_Z3fooi
; GNUOBJ: .text$unlikely$_Z3fooj
; GNUOBJ: .xdata$unlikely$_Z3fooj
; GNUOBJ: .data$gv
; GNUOBJ: .pdata$_Z3fooi
; GNUOBJ: .pdata$unlikely$_Z3fooj
declare dso_local i32 @_Z3bari(i32)
attributes #0 = { norecurse uwtable }
attributes #1 = { inlinehint uwtable }
!0 = !{!"function_section_prefix", !"unlikely"}