Files
TheRock/compiler/amd-llvm/llvm/test/ThinLTO/X86/ctor-dtor-alias2.ll
T
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

89 lines
2.7 KiB
LLVM

;; Test mixed D0/D2 and D5 COMDATs. Reduced from:
;;
;; // a.cc
;; template <typename T>
;; struct A final { virtual ~A() {} };
;; extern "C" void aa() { A<int> a; }
;; // b.cc
;; template <typename T>
;; struct A final { virtual ~A() {} };
;; template struct A<int>;
;; extern "C" void bb(Aptr a) { delete a; }
;;
;; clang -c -fpic -O0 -flto=thin a.cc && ld.lld -shared a.o b.o
;;
;; The file matches lld/test/ELF/lto/ctor-dtor-alias2.ll
; RUN: rm -rf %t && split-file %s %t && cd %t
;; a.bc defines D0 in comdat D0 and D2 in comdat D2. b.bc defines D0/D1/D2 in comdat D5.
; RUN: opt -module-summary a.ll -o a.bc
; RUN: opt -module-summary b.ll -o b.bc
; RUN: llvm-lto2 run a.bc b.bc -r=a.bc,aa,px -r=a.bc,_ZN1AIiED0Ev,px -r=a.bc,_ZN1AIiED2Ev,px -r=a.bc,_ZdlPv, \
; RUN: -r=b.bc,bb,px -r=b.bc,_ZN1AIiED0Ev, -r=b.bc,_ZN1AIiED1Ev,px -r=b.bc,_ZN1AIiED2Ev, -r=b.bc,_ZdlPv, -o out --save-temps
; RUN: llvm-dis < out.2.1.promote.bc | FileCheck %s
;; Although D0/D2 in b.bc is non-prevailing, keep D1/D2 as definitions, otherwise
;; the output may have an undefined and unsatisfied D1.
; CHECK: @_ZN1AIiED1Ev = weak_odr unnamed_addr alias void (ptr), ptr @_ZN1AIiED2Ev
; CHECK: define weak_odr void @_ZN1AIiED2Ev(ptr noundef nonnull %this) unnamed_addr comdat($_ZN1AIiED5Ev) {
; CHECK: define available_externally void @_ZN1AIiED0Ev(ptr noundef nonnull %this) unnamed_addr {
;--- a.ll
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
$_ZN1AIiED2Ev = comdat any
$_ZN1AIiED0Ev = comdat any
define void @aa() {
entry:
%a = alloca ptr, align 8
call void @_ZN1AIiED2Ev(ptr noundef nonnull %a)
ret void
}
define linkonce_odr void @_ZN1AIiED2Ev(ptr noundef nonnull %this) unnamed_addr comdat {
ret void
}
define linkonce_odr void @_ZN1AIiED0Ev(ptr noundef nonnull %this) unnamed_addr comdat {
entry:
call void @_ZN1AIiED2Ev(ptr noundef nonnull %this)
call void @_ZdlPv(ptr noundef %this)
ret void
}
declare void @_ZdlPv(ptr noundef)
;--- b.ll
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
$_ZN1AIiED5Ev = comdat any
$_ZTV1AIiE = comdat any
@_ZN1AIiED1Ev = weak_odr unnamed_addr alias void (ptr), ptr @_ZN1AIiED2Ev
define weak_odr void @_ZN1AIiED2Ev(ptr noundef nonnull %this) unnamed_addr comdat($_ZN1AIiED5Ev) {
ret void
}
define weak_odr void @_ZN1AIiED0Ev(ptr noundef nonnull %this) unnamed_addr comdat($_ZN1AIiED5Ev) {
entry:
call void @_ZN1AIiED1Ev(ptr noundef nonnull %this)
call void @_ZdlPv(ptr noundef %this)
ret void
}
declare void @_ZdlPv(ptr noundef)
define void @bb(ptr noundef %a) {
entry:
call void @_ZN1AIiED1Ev(ptr noundef nonnull %a)
call void @_ZdlPv(ptr noundef %a)
ret void
}