brintos

brintos / llvm-project-archived public Read only

0
0
Text · 810 B · 970af9f Raw
17 lines · c
1// RUN: %clang_cc1 -verify -ffreestanding -triple=aarch64-linux-gnu %s2// REQUIRES: aarch64-registered-target3 4#include <stdatomic.h>5 6void memory_checks(_Float16 *p16, __bf16 *pbf, float *pf, double *pd) {7  (void)__atomic_fetch_min(p16, (_Float16)1.0f, memory_order_relaxed);8  (void)__atomic_fetch_max(pbf, (__bf16)2.0f, memory_order_acquire);9  (void)__atomic_fetch_min(pf, 3.0f, memory_order_release);10  (void)__atomic_fetch_max(pd, 4.0, memory_order_seq_cst);11}12 13void nullPointerWarning(void) {14  (void)__atomic_fetch_min((volatile float*)0, 42.0, memory_order_relaxed); // expected-warning {{null passed to a callee that requires a non-null argument}}15  (void)__atomic_fetch_max((float*)0, 42.0, memory_order_relaxed); // expected-warning {{null passed to a callee that requires a non-null argument}}16}17