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

52 lines
1.8 KiB
LLVM

; Test that RISCVISelDAGToDAG correctly selects PseudoCALLLpadAlign and
; PseudoCALLIndirectLpadAlign for RISCVISD::LPAD_CALL and
; RISCVISD::LPAD_CALL_INDIRECT nodes (returns_twice calls with CFI enabled).
; LPAD pseudo selection is triggered by the cf-protection-branch module flag,
; not by +experimental-zicfilp.
; RUN: llc -mtriple=riscv32 -stop-after=finalize-isel \
; RUN: < %s | FileCheck %s --check-prefixes=CFP
; RUN: llc -mtriple=riscv64 -stop-after=finalize-isel \
; RUN: < %s | FileCheck %s --check-prefixes=CFP
; RUN: llc -mtriple=riscv64 -riscv-landing-pad-label=1 \
; RUN: -stop-after=finalize-isel < %s | FileCheck %s --check-prefixes=LABEL1
declare i32 @setjmp(ptr) returns_twice
; Direct returns_twice call: should select PseudoCALLLpadAlign.
define i32 @test_direct() {
; CFP-LABEL: name: test_direct
; CFP: PseudoCALLLpadAlign target-flags(riscv-call) @setjmp, 0
; LABEL1-LABEL: name: test_direct
; LABEL1: PseudoCALLLpadAlign target-flags(riscv-call) @setjmp, 1
%buf = alloca [1 x i32], align 4
%call = call i32 @setjmp(ptr %buf)
ret i32 %call
}
; Indirect returns_twice call: should select PseudoCALLIndirectLpadAlign.
define i32 @test_indirect(ptr %fptr) {
; CFP-LABEL: name: test_indirect
; CFP: PseudoCALLIndirectLpadAlign %{{[0-9]+}}, 0
; LABEL1-LABEL: name: test_indirect
; LABEL1: PseudoCALLIndirectLpadAlign %{{[0-9]+}}, 1
%call = call i32 %fptr() #0
ret i32 %call
}
; Non-returns_twice calls must NOT select PseudoCALLLpadAlign.
declare i32 @regular_func()
define i32 @test_regular_call() {
; CFP-LABEL: name: test_regular_call
; CFP-NOT: PseudoCALLLpadAlign
; CFP: PseudoCALL target-flags(riscv-call) @regular_func
%call = call i32 @regular_func()
ret i32 %call
}
attributes #0 = { returns_twice }
!llvm.module.flags = !{!0}
!0 = !{i32 8, !"cf-protection-branch", i32 1}