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
61 lines
3.4 KiB
C++
61 lines
3.4 KiB
C++
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,GNU,64
|
|
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,MSVC,64
|
|
// RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,GNU,64
|
|
// RUN: %clang_cc1 -triple aarch64_be-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,GNU,64
|
|
// RUN: %clang_cc1 -triple arm-none-eabi -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,ARM,GNU,32
|
|
|
|
// RUN: %clang_cc1 -triple arm64e-apple-ios -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all -fptrauth-calls | FileCheck %s --check-prefixes=CHECK,GNU,64,AUTH
|
|
// RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all -fptrauth-calls | FileCheck %s --check-prefixes=CHECK,GNU,64,AUTH
|
|
|
|
// GNU: define{{.*}} void @_Z3funv() #0 !func_sanitize ![[FUNCSAN:.*]] {
|
|
// MSVC: define{{.*}} void @"?fun@@YAXXZ"() #0 !func_sanitize ![[FUNCSAN:.*]] {
|
|
void fun() {}
|
|
|
|
// GNU-LABEL: define{{.*}} void @_Z6callerPFvvE(ptr noundef %f)
|
|
// MSVC-LABEL: define{{.*}} void @"?caller@@YAXP6AXXZ@Z"(ptr noundef %f)
|
|
// ARM: call ptr @llvm.ptrmask.p0.i32(ptr {{.*}}, i32 -2), !nosanitize !6
|
|
// AUTH: %[[STRIPPED:.*]] = ptrtoint ptr {{.*}} to i64, !nosanitize
|
|
// AUTH: call i64 @llvm.ptrauth.auth(i64 %[[STRIPPED]], i32 0, i64 0), !nosanitize
|
|
// CHECK: getelementptr <{ i32, i32 }>, ptr {{.*}}, i32 -1, i32 0, !nosanitize
|
|
// CHECK: load i32, ptr {{.*}}, align {{.*}}, !nosanitize
|
|
// CHECK: icmp eq i32 {{.*}}, -1056584962, !nosanitize
|
|
// CHECK: br i1 {{.*}}, label %[[LABEL1:.*]], label %[[LABEL4:.*]], !nosanitize
|
|
// CHECK: [[LABEL1]]:
|
|
// CHECK: getelementptr <{ i32, i32 }>, ptr {{.*}}, i32 -1, i32 1, !nosanitize
|
|
// CHECK: load i32, ptr {{.*}}, align {{.*}}, !nosanitize
|
|
// GNU: icmp eq i32 {{.*}}, 905068220, !nosanitize
|
|
// MSVC: icmp eq i32 {{.*}}, -1600339357, !nosanitize
|
|
// CHECK: br i1 {{.*}}, label %[[LABEL3:.*]], label %[[LABEL2:[^,]*]], {{.*}}!nosanitize
|
|
// CHECK: [[LABEL2]]:
|
|
// 64: call void @__ubsan_handle_function_type_mismatch_abort(ptr @[[#]], i64 %[[#]]) #[[#]], !nosanitize
|
|
// 32: call void @__ubsan_handle_function_type_mismatch_abort(ptr @[[#]], i32 %[[#]]) #[[#]], !nosanitize
|
|
// CHECK-NEXT: unreachable, !nosanitize
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: [[LABEL3]]:
|
|
// CHECK: br label %[[LABEL4]], !nosanitize
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: [[LABEL4]]:
|
|
// CHECK-NEXT: call void
|
|
// CHECK-NEXT: ret void
|
|
void caller(void (*f)()) { f(); }
|
|
|
|
// GNU: define{{.*}} void @_Z4fun2v() #0 {
|
|
// MSVC: define{{.*}} void @"?fun2@@YAXXZ"() #0 {
|
|
[[clang::cfi_unchecked_callee]]
|
|
void fun2() {}
|
|
|
|
typedef void (*unchecked_t)() [[clang::cfi_unchecked_callee]];
|
|
|
|
// GNU-LABEL: define{{.*}} void @_Z7caller2PFvvE(ptr noundef %f)
|
|
// MSVC-LABEL: define{{.*}} void @"?caller2@@YAXP6AXXZ@Z"(ptr noundef %f)
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: [[ADDR:%.*]] = alloca ptr
|
|
// CHECK-NEXT: store ptr %f, ptr [[ADDR]]
|
|
// CHECK-NEXT: [[FUNC:%.*]] = load ptr, ptr [[ADDR]]
|
|
// CHECK-NEXT: call void [[FUNC]]()
|
|
// CHECK-NEXT: ret void
|
|
void caller2(unchecked_t f) { f(); }
|
|
|
|
// GNU: ![[FUNCSAN]] = !{i32 -1056584962, i32 905068220}
|
|
// MSVC: ![[FUNCSAN]] = !{i32 -1056584962, i32 -1600339357}
|