| 1 |
// REQUIRES: systemz-registered-target |
| 2 |
// RUN: %clang_cc1 -target-cpu z14 -triple s390x-unknown-unknown \ |
| 3 |
// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s |
| 4 |
|
| 5 |
typedef __attribute__((vector_size(16))) signed char vec_schar; |
| 6 |
typedef __attribute__((vector_size(16))) signed short vec_sshort; |
| 7 |
typedef __attribute__((vector_size(16))) signed int vec_sint; |
| 8 |
typedef __attribute__((vector_size(16))) signed long long vec_slong; |
| 9 |
typedef __attribute__((vector_size(16))) unsigned char vec_uchar; |
| 10 |
typedef __attribute__((vector_size(16))) unsigned short vec_ushort; |
| 11 |
typedef __attribute__((vector_size(16))) unsigned int vec_uint; |
| 12 |
typedef __attribute__((vector_size(16))) unsigned long long vec_ulong; |
| 13 |
typedef __attribute__((vector_size(16))) double vec_double; |
| 14 |
typedef __attribute__((vector_size(16))) float vec_float; |
| 15 |
|
| 16 |
volatile vec_schar vsc; |
| 17 |
volatile vec_sshort vss; |
| 18 |
volatile vec_sint vsi; |
| 19 |
volatile vec_slong vsl; |
| 20 |
volatile vec_uchar vuc; |
| 21 |
volatile vec_ushort vus; |
| 22 |
volatile vec_uint vui; |
| 23 |
volatile vec_ulong vul; |
| 24 |
volatile vec_double vd; |
| 25 |
volatile vec_float vf; |
| 26 |
volatile unsigned __int128 ui128; |
| 27 |
|
| 28 |
volatile unsigned int len; |
| 29 |
int cc; |
| 30 |
|
| 31 |
void test_integer(void) { |
| 32 |
__builtin_s390_vmslg(vul, vul, ui128, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 33 |
__builtin_s390_vmslg(vul, vul, ui128, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 34 |
__builtin_s390_vmslg(vul, vul, ui128, len);// expected-error {{must be a constant integer}} |
| 35 |
} |
| 36 |
|
| 37 |
void test_float(void) { |
| 38 |
__builtin_s390_vfmaxdb(vd, vd, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 39 |
__builtin_s390_vfmaxdb(vd, vd, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 40 |
__builtin_s390_vfmaxdb(vd, vd, len); // expected-error {{must be a constant integer}} |
| 41 |
__builtin_s390_vfmindb(vd, vd, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 42 |
__builtin_s390_vfmindb(vd, vd, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 43 |
__builtin_s390_vfmindb(vd, vd, len); // expected-error {{must be a constant integer}} |
| 44 |
|
| 45 |
__builtin_s390_vftcisb(vf, -1, &cc); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 46 |
__builtin_s390_vftcisb(vf, 4096, &cc); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 47 |
__builtin_s390_vftcisb(vf, len, &cc); // expected-error {{must be a constant integer}} |
| 48 |
|
| 49 |
__builtin_s390_vfisb(vf, -1, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 50 |
__builtin_s390_vfisb(vf, 16, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 51 |
__builtin_s390_vfisb(vf, len, 0); // expected-error {{must be a constant integer}} |
| 52 |
__builtin_s390_vfisb(vf, 0, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 53 |
__builtin_s390_vfisb(vf, 0, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 54 |
__builtin_s390_vfisb(vf, 0, len); // expected-error {{must be a constant integer}} |
| 55 |
|
| 56 |
__builtin_s390_vfmaxsb(vf, vf, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 57 |
__builtin_s390_vfmaxsb(vf, vf, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 58 |
__builtin_s390_vfmaxsb(vf, vf, len); // expected-error {{must be a constant integer}} |
| 59 |
__builtin_s390_vfminsb(vf, vf, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 60 |
__builtin_s390_vfminsb(vf, vf, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 61 |
__builtin_s390_vfminsb(vf, vf, len); // expected-error {{must be a constant integer}} |
| 62 |
} |