xref: /llvm-project/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4-error.c (revision 1283ccb610feef4f2e0edf22f66a705155a0e0c7)
18cd8120aSUlrich Weigand // REQUIRES: systemz-registered-target
2*1283ccb6SUlrich Weigand // RUN: %clang_cc1 -target-cpu z16 -triple s390x-linux-gnu \
38cd8120aSUlrich Weigand // RUN: -fzvector -flax-vector-conversions=none \
48cd8120aSUlrich Weigand // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
58cd8120aSUlrich Weigand 
68cd8120aSUlrich Weigand #include <vecintrin.h>
78cd8120aSUlrich Weigand 
88cd8120aSUlrich Weigand volatile vector signed char vsc;
98cd8120aSUlrich Weigand volatile vector signed short vss;
108cd8120aSUlrich Weigand volatile vector signed int vsi;
118cd8120aSUlrich Weigand volatile vector signed long long vsl;
128cd8120aSUlrich Weigand volatile vector unsigned char vuc;
138cd8120aSUlrich Weigand volatile vector unsigned short vus;
148cd8120aSUlrich Weigand volatile vector unsigned int vui;
158cd8120aSUlrich Weigand volatile vector unsigned long long vul;
168cd8120aSUlrich Weigand volatile vector bool char vbc;
178cd8120aSUlrich Weigand volatile vector bool short vbs;
188cd8120aSUlrich Weigand volatile vector bool int vbi;
198cd8120aSUlrich Weigand volatile vector bool long long vbl;
208cd8120aSUlrich Weigand volatile vector float vf;
218cd8120aSUlrich Weigand volatile vector double vd;
228cd8120aSUlrich Weigand 
238cd8120aSUlrich Weigand volatile unsigned int len;
248cd8120aSUlrich Weigand 
test_nnp_assist(void)258cd8120aSUlrich Weigand void test_nnp_assist(void) {
268cd8120aSUlrich Weigand   vf = vec_extend_to_fp32_hi(vus, -1);         // expected-error {{argument value -1 is outside the valid range [0, 15]}}
278cd8120aSUlrich Weigand   vf = vec_extend_to_fp32_hi(vus, 16);         // expected-error {{argument value 16 is outside the valid range [0, 15]}}
288cd8120aSUlrich Weigand   vf = vec_extend_to_fp32_hi(vus, len);        // expected-error {{argument to '__builtin_s390_vclfnhs' must be a constant integer}}
298cd8120aSUlrich Weigand 
308cd8120aSUlrich Weigand   vf = vec_extend_to_fp32_lo(vus, -1);         // expected-error {{argument value -1 is outside the valid range [0, 15]}}
318cd8120aSUlrich Weigand   vf = vec_extend_to_fp32_lo(vus, 16);         // expected-error {{argument value 16 is outside the valid range [0, 15]}}
328cd8120aSUlrich Weigand   vf = vec_extend_to_fp32_lo(vus, len);        // expected-error {{argument to '__builtin_s390_vclfnls' must be a constant integer}}
338cd8120aSUlrich Weigand 
348cd8120aSUlrich Weigand   vus = vec_round_from_fp32(vf, vf, -1);       // expected-error {{argument value -1 is outside the valid range [0, 15]}}
358cd8120aSUlrich Weigand   vus = vec_round_from_fp32(vf, vf, 16);       // expected-error {{argument value 16 is outside the valid range [0, 15]}}
368cd8120aSUlrich Weigand   vus = vec_round_from_fp32(vf, vf, len);      // expected-error {{argument to '__builtin_s390_vcrnfs' must be a constant integer}}
378cd8120aSUlrich Weigand 
388cd8120aSUlrich Weigand   vus = vec_convert_to_fp16(vus, -1);          // expected-error {{argument value -1 is outside the valid range [0, 15]}}
398cd8120aSUlrich Weigand   vus = vec_convert_to_fp16(vus, 16);          // expected-error {{argument value 16 is outside the valid range [0, 15]}}
408cd8120aSUlrich Weigand   vus = vec_convert_to_fp16(vus, len);         // expected-error {{argument to '__builtin_s390_vcfn' must be a constant integer}}
418cd8120aSUlrich Weigand 
428cd8120aSUlrich Weigand   vus = vec_convert_from_fp16(vus, -1);        // expected-error {{argument value -1 is outside the valid range [0, 15]}}
438cd8120aSUlrich Weigand   vus = vec_convert_from_fp16(vus, 16);        // expected-error {{argument value 16 is outside the valid range [0, 15]}}
448cd8120aSUlrich Weigand   vus = vec_convert_from_fp16(vus, len);       // expected-error {{argument to '__builtin_s390_vcnf' must be a constant integer}}
458cd8120aSUlrich Weigand }
46