| // RUN: cir-opt %s -verify-diagnostics -split-input-file |
| |
| !s32i = !cir.int<s, 32> |
| |
| cir.func @f1(%arg0: !cir.ptr<!cir.float>, %arg1: !cir.float) { |
| // expected-error @below {{only atomic add, sub, max, min, maximum, minimum, maximum_num, and minimum_num operation could operate on floating-point values}} |
| %0 = cir.atomic.fetch and seq_cst syncscope(system) %arg0, %arg1 : (!cir.ptr<!cir.float>, !cir.float) -> !cir.float |
| cir.return |
| } |
| |
| cir.func @f2(%arg0: !cir.ptr<!s32i>, %arg1: !s32i) { |
| // expected-error @below {{atomic maximum, minimum, maximum_num, and minimum_num operation could only operate on floating-point values}} |
| %0 = cir.atomic.fetch maximum seq_cst syncscope(system) %arg0, %arg1 : (!cir.ptr<!s32i>, !s32i) -> !s32i |
| cir.return |
| } |