xref: /llvm-project/clang/test/CodeGen/SystemZ/builtins-systemz-vector5-error.c (revision 8424bf207efd89eacf2fe893b67be98d535e1db6)
1*8424bf20SUlrich Weigand // REQUIRES: systemz-registered-target
2*8424bf20SUlrich Weigand // RUN: %clang_cc1 -target-cpu arch15 -triple s390x-unknown-unknown \
3*8424bf20SUlrich Weigand // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
4*8424bf20SUlrich Weigand 
5*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) signed char vec_schar;
6*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) signed short vec_sshort;
7*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) signed int vec_sint;
8*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) signed long long vec_slong;
9*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) unsigned char vec_uchar;
10*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) unsigned short vec_ushort;
11*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) unsigned int vec_uint;
12*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) unsigned long long vec_ulong;
13*8424bf20SUlrich Weigand typedef __attribute__((vector_size(16))) double vec_double;
14*8424bf20SUlrich Weigand 
15*8424bf20SUlrich Weigand volatile vec_schar vsc;
16*8424bf20SUlrich Weigand volatile vec_sshort vss;
17*8424bf20SUlrich Weigand volatile vec_sint vsi;
18*8424bf20SUlrich Weigand volatile vec_slong vsl;
19*8424bf20SUlrich Weigand volatile vec_uchar vuc;
20*8424bf20SUlrich Weigand volatile vec_ushort vus;
21*8424bf20SUlrich Weigand volatile vec_uint vui;
22*8424bf20SUlrich Weigand volatile vec_ulong vul;
23*8424bf20SUlrich Weigand volatile vec_double vd;
24*8424bf20SUlrich Weigand 
25*8424bf20SUlrich Weigand volatile unsigned int len;
26*8424bf20SUlrich Weigand const void * volatile cptr;
27*8424bf20SUlrich Weigand int cc;
28*8424bf20SUlrich Weigand 
29*8424bf20SUlrich Weigand void test_integer(void) {
30*8424bf20SUlrich Weigand   __builtin_s390_veval(vuc, vuc, vuc, -1);    // expected-error-re {{argument value {{.*}} is outside the valid range}}
31*8424bf20SUlrich Weigand   __builtin_s390_veval(vuc, vuc, vuc, 256);   // expected-error-re {{argument value {{.*}} is outside the valid range}}
32*8424bf20SUlrich Weigand   __builtin_s390_veval(vuc, vuc, vuc, len);   // expected-error {{must be a constant integer}}
33*8424bf20SUlrich Weigand }
34*8424bf20SUlrich Weigand 
35