xref: /llvm-project/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4-error.c (revision 1283ccb610feef4f2e0edf22f66a705155a0e0c7)
1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z16 -triple s390x-linux-gnu \
3 // RUN: -fzvector -flax-vector-conversions=none \
4 // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
5 
6 #include <vecintrin.h>
7 
8 volatile vector signed char vsc;
9 volatile vector signed short vss;
10 volatile vector signed int vsi;
11 volatile vector signed long long vsl;
12 volatile vector unsigned char vuc;
13 volatile vector unsigned short vus;
14 volatile vector unsigned int vui;
15 volatile vector unsigned long long vul;
16 volatile vector bool char vbc;
17 volatile vector bool short vbs;
18 volatile vector bool int vbi;
19 volatile vector bool long long vbl;
20 volatile vector float vf;
21 volatile vector double vd;
22 
23 volatile unsigned int len;
24 
test_nnp_assist(void)25 void test_nnp_assist(void) {
26   vf = vec_extend_to_fp32_hi(vus, -1);         // expected-error {{argument value -1 is outside the valid range [0, 15]}}
27   vf = vec_extend_to_fp32_hi(vus, 16);         // expected-error {{argument value 16 is outside the valid range [0, 15]}}
28   vf = vec_extend_to_fp32_hi(vus, len);        // expected-error {{argument to '__builtin_s390_vclfnhs' must be a constant integer}}
29 
30   vf = vec_extend_to_fp32_lo(vus, -1);         // expected-error {{argument value -1 is outside the valid range [0, 15]}}
31   vf = vec_extend_to_fp32_lo(vus, 16);         // expected-error {{argument value 16 is outside the valid range [0, 15]}}
32   vf = vec_extend_to_fp32_lo(vus, len);        // expected-error {{argument to '__builtin_s390_vclfnls' must be a constant integer}}
33 
34   vus = vec_round_from_fp32(vf, vf, -1);       // expected-error {{argument value -1 is outside the valid range [0, 15]}}
35   vus = vec_round_from_fp32(vf, vf, 16);       // expected-error {{argument value 16 is outside the valid range [0, 15]}}
36   vus = vec_round_from_fp32(vf, vf, len);      // expected-error {{argument to '__builtin_s390_vcrnfs' must be a constant integer}}
37 
38   vus = vec_convert_to_fp16(vus, -1);          // expected-error {{argument value -1 is outside the valid range [0, 15]}}
39   vus = vec_convert_to_fp16(vus, 16);          // expected-error {{argument value 16 is outside the valid range [0, 15]}}
40   vus = vec_convert_to_fp16(vus, len);         // expected-error {{argument to '__builtin_s390_vcfn' must be a constant integer}}
41 
42   vus = vec_convert_from_fp16(vus, -1);        // expected-error {{argument value -1 is outside the valid range [0, 15]}}
43   vus = vec_convert_from_fp16(vus, 16);        // expected-error {{argument value 16 is outside the valid range [0, 15]}}
44   vus = vec_convert_from_fp16(vus, len);       // expected-error {{argument to '__builtin_s390_vcnf' must be a constant integer}}
45 }
46