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
85 lines
3.1 KiB
C
85 lines
3.1 KiB
C
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64le-linux-gnu \
|
|
// RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s \
|
|
// RUN: --check-prefixes=PPC64,PPC64-QUADWORD-ATOMICS
|
|
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64le-linux-gnu \
|
|
// RUN: -emit-llvm -o - %s | FileCheck %s \
|
|
// RUN: --check-prefixes=PPC64,PPC64-NO-QUADWORD-ATOMICS
|
|
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
|
|
// RUN: -target-cpu pwr7 -emit-llvm -o - %s | FileCheck %s \
|
|
// RUN: --check-prefixes=PPC64,PPC64-NO-QUADWORD-ATOMICS
|
|
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
|
|
// RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s \
|
|
// RUN: --check-prefixes=PPC64,PPC64-NO-QUADWORD-ATOMICS
|
|
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
|
|
// RUN: -mabi=quadword-atomics -target-cpu pwr8 -emit-llvm -o - %s | \
|
|
// RUN: FileCheck %s --check-prefixes=PPC64,PPC64-QUADWORD-ATOMICS
|
|
|
|
|
|
typedef struct {
|
|
char x[16];
|
|
} Q;
|
|
|
|
typedef _Atomic(Q) AtomicQ;
|
|
|
|
typedef __int128_t int128_t;
|
|
|
|
// PPC64-LABEL: @test_load(
|
|
// PPC64: [[TMP3:%.*]] = load atomic i128, ptr [[TMP1:%.*]] acquire, align 16
|
|
//
|
|
Q test_load(AtomicQ *ptr) {
|
|
// expected-no-diagnostics
|
|
return __c11_atomic_load(ptr, __ATOMIC_ACQUIRE);
|
|
}
|
|
|
|
// PPC64-LABEL: @test_store(
|
|
// PPC64: store atomic i128 [[TMP6:%.*]], ptr [[TMP4:%.*]] release, align 16
|
|
//
|
|
void test_store(Q val, AtomicQ *ptr) {
|
|
// expected-no-diagnostics
|
|
__c11_atomic_store(ptr, val, __ATOMIC_RELEASE);
|
|
}
|
|
|
|
// PPC64-LABEL: @test_add(
|
|
// PPC64: [[ATOMICRMW:%.*]] = atomicrmw add ptr [[TMP0:%.*]], i128 [[TMP2:%.*]] monotonic, align 16
|
|
//
|
|
void test_add(_Atomic(int128_t) *ptr, int128_t x) {
|
|
// expected-no-diagnostics
|
|
__c11_atomic_fetch_add(ptr, x, __ATOMIC_RELAXED);
|
|
}
|
|
|
|
// PPC64-LABEL: @test_xchg(
|
|
// PPC64: [[TMP8:%.*]] = atomicrmw xchg ptr [[TMP4:%.*]], i128 [[TMP7:%.*]] seq_cst, align 16
|
|
//
|
|
Q test_xchg(AtomicQ *ptr, Q new) {
|
|
// expected-no-diagnostics
|
|
return __c11_atomic_exchange(ptr, new, __ATOMIC_SEQ_CST);
|
|
}
|
|
|
|
// PPC64-LABEL: @test_cmpxchg(
|
|
// PPC64: [[TMP10:%.*]] = cmpxchg ptr [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
|
|
//
|
|
int test_cmpxchg(AtomicQ *ptr, Q *cmp, Q new) {
|
|
// expected-no-diagnostics
|
|
return __c11_atomic_compare_exchange_strong(ptr, cmp, new, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
|
|
}
|
|
|
|
// PPC64-LABEL: @test_cmpxchg_weak(
|
|
// PPC64: [[TMP10:%.*]] = cmpxchg weak ptr [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
|
|
//
|
|
int test_cmpxchg_weak(AtomicQ *ptr, Q *cmp, Q new) {
|
|
// expected-no-diagnostics
|
|
return __c11_atomic_compare_exchange_weak(ptr, cmp, new, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
|
|
}
|
|
|
|
// PPC64-QUADWORD-ATOMICS-LABEL: @is_lock_free(
|
|
// PPC64-QUADWORD-ATOMICS: ret i32 1
|
|
//
|
|
// PPC64-NO-QUADWORD-ATOMICS-LABEL: @is_lock_free(
|
|
// PPC64-NO-QUADWORD-ATOMICS: [[CALL:%.*]] = call zeroext i1 @__atomic_is_lock_free(i64 noundef 16, ptr noundef null)
|
|
//
|
|
int is_lock_free() {
|
|
AtomicQ q;
|
|
// expected-no-diagnostics
|
|
return __c11_atomic_is_lock_free(sizeof(q));
|
|
}
|