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

68 lines
2.1 KiB
LLVM

; Test that global constructors and destructors are run:
;
; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout -extra-module %s \
; RUN: %S/Inputs/noop-main.ll | FileCheck %s
;
; Test that this is true for global constructors and destructors in other
; JITDylibs.
; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout \
; RUN: -jd extra -extra-module %s -jd main %S/Inputs/noop-main.ll | FileCheck %s
;
; CHECK: Hello from constructor
; CHECK: Hello
; CHECK: [ {{.*}}main{{.*}} ]
; CHECK: Goodbye from atexit
; CHECK: Goodbye from __cxa_atexit
; CHECK: Goodbye from destructor
%class.Foo = type { i8 }
@f = global %class.Foo zeroinitializer, align 1
@__dso_handle = external global i8
@llvm.global_ctors = appending global [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_hello.cpp, ptr null }, { i32, ptr, ptr } { i32 1024, ptr @constructor, ptr null }]
@llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @printf_wrapper, ptr null }]
@str = private unnamed_addr constant [6 x i8] c"Hello\00"
@str2 = private unnamed_addr constant [23 x i8] c"Hello from constructor\00"
@str3 = private unnamed_addr constant [24 x i8] c"Goodbye from destructor\00"
@str4 = global [26 x i8] c"Goodbye from __cxa_atexit\00"
@str5 = global [20 x i8] c"Goodbye from atexit\00"
define linkonce_odr void @_ZN3FooD1Ev(ptr nocapture readnone %this) unnamed_addr align 2 {
entry:
%puts.i = tail call i32 @puts(ptr @str4)
ret void
}
define void @atexit_handler() {
entry:
%puts.i = tail call i32 @puts(ptr @str5)
ret void
}
declare i32 @__cxa_atexit(ptr, ptr, ptr)
declare i32 @atexit(ptr)
define internal void @_GLOBAL__sub_I_hello.cpp() {
entry:
%puts.i.i.i = tail call i32 @puts(ptr @str)
%0 = tail call i32 @__cxa_atexit(ptr @_ZN3FooD1Ev, ptr @f, ptr @__dso_handle)
%1 = tail call i32 @atexit(ptr @atexit_handler)
ret void
}
define void @printf_wrapper() {
entry:
%0 = tail call i32 @puts(ptr @str3)
ret void
}
declare i32 @puts(ptr nocapture readonly)
define void @constructor() {
entry:
%0 = tail call i32 @puts(ptr @str2)
ret void
}