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
98 lines
3.8 KiB
LLVM
98 lines
3.8 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
|
|
|
declare i64 @f(i32)
|
|
declare ptr @f2(i32)
|
|
|
|
define i32 @test_ptrauth_call(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call(
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 @f(i32 [[A0:%.*]])
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v0 = call i32 ptrauth(ptr @f, i32 0)(i32 %a0) [ "ptrauth"(i32 0, i64 0) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
define i32 @test_ptrauth_call_disc(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_disc(
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 @f(i32 [[A0:%.*]])
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v0 = call i32 ptrauth(ptr @f, i32 1, i64 5678)(i32 %a0) [ "ptrauth"(i32 1, i64 5678) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
@f_addr_disc.ref = constant ptr ptrauth(ptr @f, i32 1, i64 0, ptr @f_addr_disc.ref)
|
|
|
|
define i32 @test_ptrauth_call_addr_disc(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_addr_disc(
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 @f(i32 [[A0:%.*]])
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v0 = call i32 ptrauth(ptr @f, i32 1, i64 0, ptr @f_addr_disc.ref)(i32 %a0) [ "ptrauth"(i32 1, i64 ptrtoint (ptr @f_addr_disc.ref to i64)) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
@f_both_disc.ref = constant ptr ptrauth(ptr @f, i32 1, i64 1234, ptr @f_both_disc.ref)
|
|
|
|
define i32 @test_ptrauth_call_blend(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_blend(
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 @f(i32 [[A0:%.*]])
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v = call i64 @llvm.ptrauth.blend(i64 ptrtoint (ptr @f_both_disc.ref to i64), i64 1234)
|
|
%v0 = call i32 ptrauth(ptr @f, i32 1, i64 1234, ptr @f_both_disc.ref)(i32 %a0) [ "ptrauth"(i32 1, i64 %v) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
define i64 @test_ptrauth_call_cast(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_cast(
|
|
; CHECK-NEXT: [[V0:%.*]] = call i64 @f2(i32 [[A0:%.*]])
|
|
; CHECK-NEXT: ret i64 [[V0]]
|
|
;
|
|
%v0 = call i64 ptrauth(ptr @f2, i32 0)(i32 %a0) [ "ptrauth"(i32 0, i64 0) ]
|
|
ret i64 %v0
|
|
}
|
|
|
|
define i32 @test_ptrauth_call_mismatch_key(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_mismatch_key(
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 ptrauth (ptr @f, i32 1, i64 5678)(i32 [[A0:%.*]]) [ "ptrauth"(i32 0, i64 5678) ]
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v0 = call i32 ptrauth(ptr @f, i32 1, i64 5678)(i32 %a0) [ "ptrauth"(i32 0, i64 5678) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
define i32 @test_ptrauth_call_mismatch_disc(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_mismatch_disc(
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 ptrauth (ptr @f, i32 1, i64 5678)(i32 [[A0:%.*]]) [ "ptrauth"(i32 1, i64 0) ]
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v0 = call i32 ptrauth(ptr @f, i32 1, i64 5678)(i32 %a0) [ "ptrauth"(i32 1, i64 0) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
define i32 @test_ptrauth_call_mismatch_blend(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_mismatch_blend(
|
|
; CHECK-NEXT: [[V:%.*]] = call i64 @llvm.ptrauth.blend(i64 ptrtoint (ptr @f_both_disc.ref to i64), i64 0)
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 ptrauth (ptr @f, i32 1, i64 1234, ptr @f_both_disc.ref)(i32 [[A0:%.*]]) [ "ptrauth"(i32 1, i64 [[V]]) ]
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v = call i64 @llvm.ptrauth.blend(i64 ptrtoint (ptr @f_both_disc.ref to i64), i64 0)
|
|
%v0 = call i32 ptrauth(ptr @f, i32 1, i64 1234, ptr @f_both_disc.ref)(i32 %a0) [ "ptrauth"(i32 1, i64 %v) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
define i32 @test_ptrauth_call_mismatch_blend_addr(i32 %a0) {
|
|
; CHECK-LABEL: @test_ptrauth_call_mismatch_blend_addr(
|
|
; CHECK-NEXT: [[V:%.*]] = call i64 @llvm.ptrauth.blend(i64 ptrtoint (ptr @f_addr_disc.ref to i64), i64 1234)
|
|
; CHECK-NEXT: [[V0:%.*]] = call i32 ptrauth (ptr @f, i32 1, i64 1234, ptr @f_both_disc.ref)(i32 [[A0:%.*]]) [ "ptrauth"(i32 1, i64 [[V]]) ]
|
|
; CHECK-NEXT: ret i32 [[V0]]
|
|
;
|
|
%v = call i64 @llvm.ptrauth.blend(i64 ptrtoint (ptr @f_addr_disc.ref to i64), i64 1234)
|
|
%v0 = call i32 ptrauth(ptr @f, i32 1, i64 1234, ptr @f_both_disc.ref)(i32 %a0) [ "ptrauth"(i32 1, i64 %v) ]
|
|
ret i32 %v0
|
|
}
|
|
|
|
declare i64 @llvm.ptrauth.blend(i64, i64)
|