1 // REQUIRES: systemz-registered-target 2 // 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 %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 signed char sc; 24 volatile signed short ss; 25 volatile signed int si; 26 volatile signed long long sl; 27 volatile unsigned char uc; 28 volatile unsigned short us; 29 volatile unsigned int ui; 30 volatile unsigned long long ul; 31 volatile float f; 32 volatile double d; 33 34 const void * volatile cptr; 35 const signed char * volatile cptrsc; 36 const signed short * volatile cptrss; 37 const signed int * volatile cptrsi; 38 const signed long long * volatile cptrsl; 39 const unsigned char * volatile cptruc; 40 const unsigned short * volatile cptrus; 41 const unsigned int * volatile cptrui; 42 const unsigned long long * volatile cptrul; 43 const float * volatile cptrf; 44 const double * volatile cptrd; 45 46 void * volatile ptr; 47 signed char * volatile ptrsc; 48 signed short * volatile ptrss; 49 signed int * volatile ptrsi; 50 signed long long * volatile ptrsl; 51 unsigned char * volatile ptruc; 52 unsigned short * volatile ptrus; 53 unsigned int * volatile ptrui; 54 unsigned long long * volatile ptrul; 55 float * volatile ptrf; 56 double * volatile ptrd; 57 58 volatile unsigned int len; 59 volatile int idx; 60 int cc; 61 62 void test_core(void) { 63 vf = vec_gather_element(vf, vui, cptrf, idx); // expected-error {{no matching function}} 64 // [email protected]:* 7 {{candidate function not viable}} 65 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 66 vf = vec_gather_element(vf, vui, cptrf, -1); // expected-error {{no matching function}} 67 // [email protected]:* 7 {{candidate function not viable}} 68 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 69 vf = vec_gather_element(vf, vui, cptrf, 4); // expected-error {{no matching function}} 70 // [email protected]:* 7 {{candidate function not viable}} 71 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 72 vd = vec_gather_element(vd, vul, cptrd, idx); // expected-error {{no matching function}} 73 // [email protected]:* 7 {{candidate function not viable}} 74 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 75 vd = vec_gather_element(vd, vul, cptrd, -1); // expected-error {{no matching function}} 76 // [email protected]:* 7 {{candidate function not viable}} 77 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 78 vd = vec_gather_element(vd, vul, cptrd, 2); // expected-error {{no matching function}} 79 // [email protected]:* 7 {{candidate function not viable}} 80 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 81 82 vec_scatter_element(vf, vui, ptrf, idx); // expected-error {{no matching function}} 83 // [email protected]:* 7 {{candidate function not viable}} 84 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 85 vec_scatter_element(vf, vui, ptrf, -1); // expected-error {{no matching function}} 86 // [email protected]:* 7 {{candidate function not viable}} 87 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 88 vec_scatter_element(vf, vui, ptrf, 4); // expected-error {{no matching function}} 89 // [email protected]:* 7 {{candidate function not viable}} 90 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 91 vec_scatter_element(vd, vul, ptrd, idx); // expected-error {{no matching function}} 92 // [email protected]:* 7 {{candidate function not viable}} 93 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 94 vec_scatter_element(vd, vul, ptrd, -1); // expected-error {{no matching function}} 95 // [email protected]:* 7 {{candidate function not viable}} 96 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 97 vec_scatter_element(vd, vul, ptrd, 2); // expected-error {{no matching function}} 98 // [email protected]:* 7 {{candidate function not viable}} 99 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 100 101 vf = vec_splat(vf, idx); // expected-error {{no matching function}} 102 // [email protected]:* 13 {{candidate function not viable}} 103 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 104 vf = vec_splat(vf, -1); // expected-error {{no matching function}} 105 // [email protected]:* 13 {{candidate function not viable}} 106 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 107 vf = vec_splat(vf, 4); // expected-error {{no matching function}} 108 // [email protected]:* 13 {{candidate function not viable}} 109 // [email protected]:* 1 {{must be a constant integer from 0 to 3}} 110 vd = vec_splat(vd, idx); // expected-error {{no matching function}} 111 // [email protected]:* 13 {{candidate function not viable}} 112 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 113 vd = vec_splat(vd, -1); // expected-error {{no matching function}} 114 // [email protected]:* 13 {{candidate function not viable}} 115 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 116 vd = vec_splat(vd, 2); // expected-error {{no matching function}} 117 // [email protected]:* 13 {{candidate function not viable}} 118 // [email protected]:* 1 {{must be a constant integer from 0 to 1}} 119 } 120 121 void test_integer(void) { 122 vf = vec_sld(vf, vf, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}} 123 // [email protected]:* 13 {{candidate function not viable}} 124 // [email protected]:* 1 {{must be a constant integer from 0 to 15}} 125 vd = vec_sld(vd, vd, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}} 126 // [email protected]:* 13 {{candidate function not viable}} 127 // [email protected]:* 1 {{must be a constant integer from 0 to 15}} 128 129 vuc = vec_msum_u128(vul, vul, vuc, idx); // expected-error {{must be a constant integer}} 130 vuc = vec_msum_u128(vul, vul, vuc, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} 131 vuc = vec_msum_u128(vul, vul, vuc, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}} 132 } 133 134 void test_float(void) { 135 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}} 136 // [email protected]:* 1 {{candidate function not viable}} 137 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}} 138 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]}} 139 // [email protected]:* 1 {{candidate function not viable}} 140 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}} 141 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]}} 142 // [email protected]:* 1 {{candidate function not viable}} 143 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}} 144 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}} 145 // [email protected]:* 1 {{candidate function not viable}} 146 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}} 147 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]}} 148 // [email protected]:* 1 {{candidate function not viable}} 149 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}} 150 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]}} 151 // [email protected]:* 1 {{candidate function not viable}} 152 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}} 153 } 154