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
134 lines
3.5 KiB
LLVM
134 lines
3.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
|
|
; RUN: opt -passes=mergefunc -S < %s | FileCheck %s
|
|
; Ensure MergeFunc handles ConstantPtrAuth correctly and does not
|
|
; merge when any ptrauth operand differs (ptr, key, int disc, addr disc).
|
|
; Each pair of functions differs only in a single ptrauth component but shares
|
|
; the same return value, so disabling any single comparison would cause a
|
|
; test failure due to unexpected merging.
|
|
|
|
target triple = "arm64e-apple-ios14.0.0"
|
|
|
|
declare void @baz()
|
|
@ADDR = external global i8
|
|
|
|
declare void @callee(ptr)
|
|
|
|
; different base pointer (null vs @baz)
|
|
|
|
define i32 @f_ptr_null() {
|
|
; CHECK-LABEL: define i32 @f_ptr_null() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr null, i32 0))
|
|
; CHECK-NEXT: ret i32 1
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr null, i32 0))
|
|
ret i32 1
|
|
}
|
|
|
|
define i32 @g_ptr_baz() {
|
|
; CHECK-LABEL: define i32 @g_ptr_baz() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
; CHECK-NEXT: ret i32 1
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
ret i32 1
|
|
}
|
|
|
|
; different key (i32 0 vs i32 1)
|
|
|
|
define i32 @f_key0() {
|
|
; CHECK-LABEL: define i32 @f_key0() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
; CHECK-NEXT: ret i32 2
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
ret i32 2
|
|
}
|
|
|
|
define i32 @g_key1() {
|
|
; CHECK-LABEL: define i32 @g_key1() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 1))
|
|
; CHECK-NEXT: ret i32 2
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 1))
|
|
ret i32 2
|
|
}
|
|
|
|
; different integer disc (i64 0 vs i64 7)
|
|
|
|
define i32 @f_disc0() {
|
|
; CHECK-LABEL: define i32 @f_disc0() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
; CHECK-NEXT: ret i32 3
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
ret i32 3
|
|
}
|
|
|
|
define i32 @g_disc7() {
|
|
; CHECK-LABEL: define i32 @g_disc7() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 7))
|
|
; CHECK-NEXT: ret i32 3
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 7))
|
|
ret i32 3
|
|
}
|
|
|
|
; different addr disc (ptr null vs @ADDR)
|
|
|
|
define i32 @f_addr_null() {
|
|
; CHECK-LABEL: define i32 @f_addr_null() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
; CHECK-NEXT: ret i32 4
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0))
|
|
ret i32 4
|
|
}
|
|
|
|
define i32 @g_addr_ADDR() {
|
|
; CHECK-LABEL: define i32 @g_addr_ADDR() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
|
|
; CHECK-NEXT: ret i32 4
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
|
|
ret i32 4
|
|
}
|
|
|
|
; positive test: identical ptrauth operands, should be merged
|
|
|
|
define void @merge_ptrauth_a() {
|
|
; CHECK-LABEL: define void @merge_ptrauth_a() {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
|
|
ret void
|
|
}
|
|
|
|
define void @merge_ptrauth_b() {
|
|
; CHECK-LABEL: define void @merge_ptrauth_b() {
|
|
; CHECK-NEXT: tail call void @merge_ptrauth_a()
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
|
|
ret void
|
|
}
|