| 1 |
// RUN: %clang_cc1 -verify -ffreestanding -triple=aarch64-linux-gnu %s |
| 2 |
// REQUIRES: aarch64-registered-target |
| 3 |
|
| 4 |
#include <stdatomic.h> |
| 5 |
|
| 6 |
void 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 |
|
| 13 |
void 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 |
} |