brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.2 KiB · 0f2841d Raw
166 lines · c
1// REQUIRES: systemz-registered-target2// RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \3// RUN: -fzvector -flax-vector-conversions=none \4// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s5 6#include <vecintrin.h>7 8volatile vector signed char vsc;9volatile vector signed short vss;10volatile vector signed int vsi;11volatile vector signed long long vsl;12volatile vector signed __int128 vslll;13volatile vector unsigned char vuc;14volatile vector unsigned short vus;15volatile vector unsigned int vui;16volatile vector unsigned long long vul;17volatile vector unsigned __int128 vulll;18volatile vector bool char vbc;19volatile vector bool short vbs;20volatile vector bool int vbi;21volatile vector bool long long vbl;22volatile vector float vf;23volatile vector double vd;24 25volatile signed char sc;26volatile signed short ss;27volatile signed int si;28volatile signed long long sl;29volatile unsigned char uc;30volatile unsigned short us;31volatile unsigned int ui;32volatile unsigned long long ul;33volatile float f;34volatile double d;35 36const void * volatile cptr;37const signed char * volatile cptrsc;38const signed short * volatile cptrss;39const signed int * volatile cptrsi;40const signed long long * volatile cptrsl;41const unsigned char * volatile cptruc;42const unsigned short * volatile cptrus;43const unsigned int * volatile cptrui;44const unsigned long long * volatile cptrul;45const float * volatile cptrf;46const double * volatile cptrd;47 48void * volatile ptr;49signed char * volatile ptrsc;50signed short * volatile ptrss;51signed int * volatile ptrsi;52signed long long * volatile ptrsl;53unsigned char * volatile ptruc;54unsigned short * volatile ptrus;55unsigned int * volatile ptrui;56unsigned long long * volatile ptrul;57float * volatile ptrf;58double * volatile ptrd;59 60volatile unsigned int len;61volatile int idx;62int cc;63 64void test_core(void) {65  vf = vec_gather_element(vf, vui, cptrf, idx);    // expected-error {{no matching function}}66                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}67                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}68  vf = vec_gather_element(vf, vui, cptrf, -1);     // expected-error {{no matching function}}69                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}70                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}71  vf = vec_gather_element(vf, vui, cptrf, 4);      // expected-error {{no matching function}}72                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}73                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}74  vd = vec_gather_element(vd, vul, cptrd, idx);    // expected-error {{no matching function}}75                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}76                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}77  vd = vec_gather_element(vd, vul, cptrd, -1);     // expected-error {{no matching function}}78                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}79                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}80  vd = vec_gather_element(vd, vul, cptrd, 2);      // expected-error {{no matching function}}81                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}82                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}83 84  vec_scatter_element(vf, vui, ptrf, idx);   // expected-error {{no matching function}}85                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}86                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}87  vec_scatter_element(vf, vui, ptrf, -1);    // expected-error {{no matching function}}88                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}89                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}90  vec_scatter_element(vf, vui, ptrf, 4);     // expected-error {{no matching function}}91                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}92                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}93  vec_scatter_element(vd, vul, ptrd, idx);   // expected-error {{no matching function}}94                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}95                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}96  vec_scatter_element(vd, vul, ptrd, -1);    // expected-error {{no matching function}}97                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}98                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}99  vec_scatter_element(vd, vul, ptrd, 2);     // expected-error {{no matching function}}100                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}101                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}102 103  vf = vec_splat(vf, idx);   // expected-error {{no matching function}}104                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}105                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}106  vf = vec_splat(vf, -1);    // expected-error {{no matching function}}107                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}108                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}109  vf = vec_splat(vf, 4);     // expected-error {{no matching function}}110                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}111                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}112  vd = vec_splat(vd, idx);   // expected-error {{no matching function}}113                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}114                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}115  vd = vec_splat(vd, -1);    // expected-error {{no matching function}}116                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}117                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}118  vd = vec_splat(vd, 2);     // expected-error {{no matching function}}119                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}120                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}121}122 123void test_integer(void) {124  vf = vec_sld(vf, vf, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}}125                             // expected-note@vecintrin.h:* 15 {{candidate function not viable}}126                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}127  vd = vec_sld(vd, vd, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}}128                             // expected-note@vecintrin.h:* 15 {{candidate function not viable}}129                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}130 131  vulll = vec_msum(vul, vul, vulll, idx);   // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vmslg' must be a constant integer}}132                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}133  vulll = vec_msum(vul, vul, vulll, -1);    // expected-error {{no matching function}} expected-error {{argument value -1 is outside the valid range [0, 15]}}134                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}135  vulll = vec_msum(vul, vul, vulll, 16);    // expected-error {{no matching function}} expected-error {{argument value 16 is outside the valid range [0, 15]}}136                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}137 138  vuc = vec_msum_u128(vul, vul, vuc, idx);  // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vmslg' must be a constant integer}}139                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}140  vuc = vec_msum_u128(vul, vul, vuc, -1);   // expected-error {{no matching function}} expected-error {{argument value -1 is outside the valid range [0, 15]}}141                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}142  vuc = vec_msum_u128(vul, vul, vuc, 16);   // expected-error {{no matching function}} expected-error {{argument value 16 is outside the valid range [0, 15]}}143                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}144}145 146void test_float(void) {147  vbi = vec_fp_test_data_class(vf, idx, &cc);  // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vftcisb' must be a constant integer}} expected-error {{argument to '__builtin_s390_vftcidb' must be a constant integer}}148                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}149                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}150  vbi = vec_fp_test_data_class(vf, -1, &cc);   // expected-error {{no matching function}} expected-error 2{{argument value -1 is outside the valid range [0, 4095]}}151                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}152                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}153  vbi = vec_fp_test_data_class(vf, 4096, &cc); // expected-error {{no matching function}} expected-error 2{{argument value 4096 is outside the valid range [0, 4095]}}154                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}155                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}156  vbl = vec_fp_test_data_class(vd, idx, &cc);  // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vftcisb' must be a constant integer}} expected-error {{argument to '__builtin_s390_vftcidb' must be a constant integer}}157                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}158                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}159  vbl = vec_fp_test_data_class(vd, -1, &cc);   // expected-error {{no matching function}} expected-error 2{{argument value -1 is outside the valid range [0, 4095]}}160                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}161                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}162  vbl = vec_fp_test_data_class(vd, 4096, &cc); // expected-error {{no matching function}} expected-error 2{{argument value 4096 is outside the valid range [0, 4095]}}163                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}164                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}165}166