xref: /llvm-project/llvm/test/Verifier/bswap.ll (revision b76bbcc60db6cd7d42bf46f2fcdc6784250554d7)
1; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
2; Check handling of bswap with unsupported sizes.
3
4declare i8 @llvm.bswap.i8(i8)
5declare <2 x i8> @llvm.bswap.v2i8(<2 x i8>)
6
7declare i12 @llvm.bswap.i12(i12)
8declare <2 x i12> @llvm.bswap.v2i12(<2 x i12>)
9
10declare i18 @llvm.bswap.i18(i18)
11declare <2 x i18> @llvm.bswap.v2i18(<2 x i18>)
12
13define i8 @bswap_i8(i8 %arg) {
14; CHECK: bswap must be an even number of bytes
15; CHECK-NEXT: %res = call i8 @llvm.bswap.i8(i8 %arg)
16  %res = call i8 @llvm.bswap.i8(i8 %arg)
17  ret i8 %res
18}
19
20define <2 x i8> @bswap_v2i8(<2 x i8> %arg) {
21; CHECK: bswap must be an even number of bytes
22; CHECK-NEXT: %res = call <2 x i8> @llvm.bswap.v2i8(<2 x i8> %arg)
23  %res = call <2 x i8> @llvm.bswap.v2i8(<2 x i8> %arg)
24  ret <2 x i8> %res
25}
26
27define i12 @bswap_i12(i12 %arg) {
28; CHECK: bswap must be an even number of bytes
29; CHECK-NEXT: %res = call i12 @llvm.bswap.i12(i12 %arg)
30  %res = call i12 @llvm.bswap.i12(i12 %arg)
31  ret i12 %res
32}
33
34define <2 x i12> @bswap_v2i12(<2 x i12> %arg) {
35; CHECK: bswap must be an even number of bytes
36; CHECK-NEXT: %res = call <2 x i12> @llvm.bswap.v2i12(<2 x i12> %arg)
37  %res = call <2 x i12> @llvm.bswap.v2i12(<2 x i12> %arg)
38  ret <2 x i12> %res
39}
40
41define i18 @bswap_i18(i18 %arg) {
42; CHECK: bswap must be an even number of bytes
43; CHECK-NEXT: %res = call i18 @llvm.bswap.i18(i18 %arg)
44  %res = call i18 @llvm.bswap.i18(i18 %arg)
45  ret i18 %res
46}
47
48define <2 x i18> @bswap_v2i18(<2 x i18> %arg) {
49; CHECK: bswap must be an even number of bytes
50; CHECK-NEXT: %res = call <2 x i18> @llvm.bswap.v2i18(<2 x i18> %arg)
51  %res = call <2 x i18> @llvm.bswap.v2i18(<2 x i18> %arg)
52  ret <2 x i18> %res
53}
54