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
113 lines
3.5 KiB
ArmAsm
113 lines
3.5 KiB
ArmAsm
## Test that BOLT handles large code model LSDA encoding correctly:
|
|
## 1. Auto-detection via .ltext sections
|
|
## 2. Disabling auto-detection with --large-code-model=0
|
|
## 3. Forcing large code model with --large-code-model flag
|
|
|
|
# REQUIRES: system-linux
|
|
|
|
## Build two variants: one with .ltext section, one without.
|
|
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux \
|
|
# RUN: --defsym LTEXT=1 %s -o %t.ltext.o
|
|
# RUN: ld.lld --no-pie %t.ltext.o -o %t.ltext.exe -q -e _start
|
|
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux \
|
|
# RUN: --defsym LTEXT=0 %s -o %t.text.o
|
|
# RUN: ld.lld --no-pie %t.text.o -o %t.text.exe -q -e _start
|
|
|
|
## Test 1: Auto-detection via .ltext section.
|
|
# RUN: llvm-bolt %t.ltext.exe -o %t.ltext.bolt --reorder-blocks=none 2>&1 \
|
|
# RUN: | FileCheck %s --check-prefix=CHECK-BOLT
|
|
# CHECK-BOLT: enabling large code model
|
|
|
|
# RUN: llvm-dwarfdump --eh-frame %t.ltext.bolt \
|
|
# RUN: | FileCheck %s --check-prefix=CHECK-EH
|
|
|
|
## Test 2: Disable large code model with --large-code-model=0, overriding
|
|
## auto-detection even though .ltext is present.
|
|
# RUN: llvm-bolt %t.ltext.exe -o %t.ltext.bolt2 --reorder-blocks=none \
|
|
# RUN: --large-code-model=0 2>&1 \
|
|
# RUN: | FileCheck %s --check-prefix=CHECK-DISABLED
|
|
# CHECK-DISABLED-NOT: enabling large code model
|
|
|
|
# RUN: llvm-dwarfdump --eh-frame %t.ltext.bolt2 \
|
|
# RUN: | FileCheck %s --check-prefix=CHECK-EH
|
|
|
|
## Test 3: --large-code-model flag forces large code model on a binary
|
|
## without .ltext sections. No auto-detection message is printed since the
|
|
## flag is explicit, but the LSDA encoding should still be updated.
|
|
# RUN: llvm-bolt %t.text.exe -o %t.text.bolt --reorder-blocks=none \
|
|
# RUN: --large-code-model 2>&1 \
|
|
# RUN: | FileCheck %s --check-prefix=CHECK-FORCED
|
|
# CHECK-FORCED-NOT: enabling large code model
|
|
|
|
# RUN: llvm-dwarfdump --eh-frame %t.text.bolt \
|
|
# RUN: | FileCheck %s --check-prefix=CHECK-EH
|
|
|
|
## Verify the BOLT-emitted CIE uses 8-byte LSDA encoding (DW_EH_PE_absptr
|
|
## = 0x00) instead of the default 4-byte encoding (DW_EH_PE_sdata4 = 0x1B).
|
|
## In the "zLR" augmentation data: [L-enc] [R-enc].
|
|
# CHECK-EH: Augmentation: "zLR"
|
|
# CHECK-EH: Augmentation data: 00 1B
|
|
|
|
.text
|
|
.globl foo
|
|
.type foo, @function
|
|
foo:
|
|
.cfi_startproc
|
|
ret
|
|
.cfi_endproc
|
|
.size foo, .-foo
|
|
|
|
.globl _start
|
|
.type _start, @function
|
|
_start:
|
|
.Lfunc_begin0:
|
|
.cfi_startproc
|
|
.cfi_lsda 27, .Lexception0
|
|
call foo
|
|
.Ltmp0:
|
|
call foo
|
|
.Ltmp1:
|
|
ret
|
|
|
|
## Landing pads.
|
|
.LLP0:
|
|
ret
|
|
.LLP1:
|
|
ret
|
|
|
|
.cfi_endproc
|
|
.Lfunc_end0:
|
|
.size _start, .Lfunc_end0-_start
|
|
|
|
## Exception table.
|
|
.section .gcc_except_table,"a",@progbits
|
|
.p2align 2
|
|
.Lexception0:
|
|
.byte 255 # @LPStart Encoding = omit
|
|
.byte 255 # @TType Encoding = omit
|
|
.byte 1 # Call site Encoding = uleb128
|
|
.uleb128 .Lcst_end0-.Lcst_begin0
|
|
.Lcst_begin0:
|
|
.uleb128 .Lfunc_begin0-.Lfunc_begin0 # Call Site 1
|
|
.uleb128 .Ltmp0-.Lfunc_begin0
|
|
.uleb128 .LLP0-.Lfunc_begin0 # landing pad
|
|
.byte 0 # action: cleanup
|
|
.uleb128 .Ltmp0-.Lfunc_begin0 # Call Site 2
|
|
.uleb128 .Ltmp1-.Ltmp0
|
|
.uleb128 .LLP1-.Lfunc_begin0 # landing pad
|
|
.byte 0 # action: cleanup
|
|
.Lcst_end0:
|
|
|
|
## When LTEXT=1, emit large_func in .ltext to trigger auto-detection.
|
|
.if LTEXT
|
|
.section .ltext,"axl",@progbits
|
|
.globl large_func
|
|
.type large_func, @function
|
|
large_func:
|
|
.cfi_startproc
|
|
movl $42, %eax
|
|
retq
|
|
.cfi_endproc
|
|
.size large_func, .-large_func
|
|
.endif
|