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
119 lines
10 KiB
C
119 lines
10 KiB
C
// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s
|
|
// RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -fptrauth-intrinsics %s
|
|
|
|
#include <stdatomic.h>
|
|
|
|
int i;
|
|
int *__ptrauth(2, 1, 100) authenticated_ptr = &i;
|
|
int *__ptrauth(2, 0, 200) non_addr_discriminatedauthenticated_ptr = &i;
|
|
int * wat = &i;
|
|
#define ATOMIZE(p) (__typeof__(p) volatile _Atomic *)(long)(&p)
|
|
|
|
void f() {
|
|
static int j = 1;
|
|
__c11_atomic_init(ATOMIZE(authenticated_ptr), 5);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__c11_atomic_store(ATOMIZE(authenticated_ptr), 0, memory_order_relaxed);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__c11_atomic_load(ATOMIZE(authenticated_ptr), memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__c11_atomic_store(ATOMIZE(authenticated_ptr), 1, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_store_n(ATOMIZE(authenticated_ptr), 4, memory_order_release);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_store(ATOMIZE(authenticated_ptr), j, memory_order_release);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__c11_atomic_exchange(ATOMIZE(authenticated_ptr), 1, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_exchange(ATOMIZE(authenticated_ptr), &j, &j, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__c11_atomic_fetch_add(ATOMIZE(authenticated_ptr), 1, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_fetch_add(ATOMIZE(authenticated_ptr), 3, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_fetch_sub(ATOMIZE(authenticated_ptr), 3, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_fetch_min(ATOMIZE(authenticated_ptr), 3, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_fetch_max(ATOMIZE(authenticated_ptr), 3, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__c11_atomic_fetch_and(ATOMIZE(authenticated_ptr), 1, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_fetch_and(ATOMIZE(authenticated_ptr), 3, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_fetch_or(ATOMIZE(authenticated_ptr), 3, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
__atomic_fetch_xor(ATOMIZE(authenticated_ptr), 3, memory_order_seq_cst);
|
|
// expected-error@-1 {{address argument to atomic operation must be a pointer to a non address discriminated type ('volatile __ptrauth(2,1,100) _Atomic(int *) *' invalid)}}
|
|
|
|
__c11_atomic_init(ATOMIZE(non_addr_discriminatedauthenticated_ptr), &j);
|
|
__c11_atomic_store(ATOMIZE(non_addr_discriminatedauthenticated_ptr), 0, memory_order_relaxed);
|
|
__c11_atomic_load(ATOMIZE(non_addr_discriminatedauthenticated_ptr), memory_order_seq_cst);
|
|
__atomic_store(&j, ATOMIZE(non_addr_discriminatedauthenticated_ptr), memory_order_release);
|
|
// expected-error@-1 {{incompatible pointer types passing 'volatile __ptrauth(2,0,200) _Atomic(int *) *' to parameter of type 'int *'}}
|
|
__c11_atomic_exchange(ATOMIZE(j), ATOMIZE(non_addr_discriminatedauthenticated_ptr), memory_order_seq_cst);
|
|
// expected-error@-1 {{incompatible pointer to integer conversion passing 'volatile __ptrauth(2,0,200) _Atomic(int *) *' to parameter of type 'typeof (j)' (aka 'int')}}
|
|
__c11_atomic_fetch_add(ATOMIZE(non_addr_discriminatedauthenticated_ptr), ATOMIZE(j), memory_order_seq_cst);
|
|
// expected-error@-1 {{incompatible pointer to integer conversion passing 'volatile _Atomic(typeof (j)) *' to parameter of type '__ptrdiff_t'}}
|
|
__c11_atomic_fetch_and(ATOMIZE(j), ATOMIZE(non_addr_discriminatedauthenticated_ptr), memory_order_seq_cst);
|
|
// expected-error@-1 {{incompatible pointer to integer conversion passing 'volatile __ptrauth(2,0,200) _Atomic(int *) *' to parameter of type 'typeof (j)' (aka 'int')}}
|
|
|
|
|
|
__sync_fetch_and_add(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_fetch_and_sub(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_fetch_and_or(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_fetch_and_and(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_fetch_and_xor(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_fetch_and_nand(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
|
|
__sync_add_and_fetch(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_sub_and_fetch(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_or_and_fetch(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_and_and_fetch(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_xor_and_fetch(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_nand_and_fetch(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
|
|
__sync_bool_compare_and_swap(&authenticated_ptr, 1, 0);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_val_compare_and_swap(&authenticated_ptr, 1, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
|
|
__sync_lock_test_and_set(&authenticated_ptr, 1);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
__sync_lock_release(&authenticated_ptr);
|
|
// expected-error@-1 {{address argument to __sync operation must be a pointer to a non address discriminated type ('int *__ptrauth(2,1,100)' invalid)}}
|
|
|
|
|
|
int i = 0;
|
|
|
|
__sync_fetch_and_add(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_fetch_and_sub(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_fetch_and_or(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_fetch_and_and(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_fetch_and_xor(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
|
|
__sync_add_and_fetch(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_sub_and_fetch(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_or_and_fetch(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_and_and_fetch(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_xor_and_fetch(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
|
|
__sync_bool_compare_and_swap(&non_addr_discriminatedauthenticated_ptr, &i, &i);
|
|
__sync_val_compare_and_swap(&non_addr_discriminatedauthenticated_ptr, &i, &i);
|
|
|
|
__sync_lock_test_and_set(&non_addr_discriminatedauthenticated_ptr, &i);
|
|
__sync_lock_release(&non_addr_discriminatedauthenticated_ptr);
|
|
}
|