xref: /llvm-project/llvm/test/Assembler/invalid-atomicrmw-scalable.ll (revision 4cb110a84f587d3c65b85d79ab6fc8aa5489fb86)
1; RUN: split-file %s %t --leading-lines
2; RUN: not llvm-as < %t/scalable_fp_vector_atomicrmw_xchg.ll 2>&1 | FileCheck -check-prefix=ERR0 %s
3; RUN: not llvm-as < %t/scalable_int_vector_atomicrmw_xchg.ll 2>&1 | FileCheck -check-prefix=ERR1 %s
4; RUN: not llvm-as < %t/scalable_ptr_vector_atomicrmw_xchg.ll 2>&1 | FileCheck -check-prefix=ERR2 %s
5; RUN: not llvm-as < %t/scalable_fp_vector_atomicrmw_fadd.ll 2>&1 | FileCheck -check-prefix=ERR3 %s
6; RUN: not llvm-as < %t/scalable_int_vector_atomicrmw_add.ll 2>&1 | FileCheck -check-prefix=ERR4 %s
7
8;--- scalable_fp_vector_atomicrmw_xchg.ll
9define <vscale x 2 x half> @scalable_fp_vector_atomicrmw_xchg(ptr %x, <vscale x 2 x half> %val) {
10; ERR0: :41: error: atomicrmw operand may not be scalable
11  %atomic.xchg = atomicrmw xchg ptr %x, <vscale x 2 x half> %val seq_cst
12  ret <vscale x 2 x half> %atomic.xchg
13}
14
15;--- scalable_int_vector_atomicrmw_xchg.ll
16define <vscale x 2 x i16> @scalable_int_vector_atomicrmw_xchg(ptr %x, <vscale x 2 x i16> %val) {
17; ERR1: :41: error: atomicrmw operand may not be scalable
18  %atomic.xchg = atomicrmw xchg ptr %x, <vscale x 2 x i16> %val seq_cst
19  ret <vscale x 2 x i16> %atomic.xchg
20}
21
22;--- scalable_ptr_vector_atomicrmw_xchg.ll
23define <vscale x 2 x ptr> @scalable_ptr_vector_atomicrmw_xchg(ptr %x, <vscale x 2 x ptr> %val) {
24; ERR2: :41: error: atomicrmw operand may not be scalable
25  %atomic.xchg = atomicrmw xchg ptr %x, <vscale x 2 x ptr> %val seq_cst
26  ret <vscale x 2 x ptr> %atomic.xchg
27}
28
29;--- scalable_fp_vector_atomicrmw_fadd.ll
30define <vscale x 2 x half> @scalable_fp_vector_atomicrmw_fadd(ptr %x, <vscale x 2 x half> %val) {
31; ERR3: :41: error: atomicrmw operand may not be scalable
32  %atomic.fadd = atomicrmw fadd ptr %x, <vscale x 2 x half> %val seq_cst
33  ret <vscale x 2 x half> %atomic.fadd
34}
35
36;--- scalable_int_vector_atomicrmw_add.ll
37define <vscale x 2 x i16> @scalable_int_vector_atomicrmw_add(ptr %x, <vscale x 2 x i16> %val) {
38; ERR4: :39: error: atomicrmw operand may not be scalable
39  %atomic.add = atomicrmw add ptr %x, <vscale x 2 x i16> %val seq_cst
40  ret <vscale x 2 x i16> %atomic.add
41}
42