blob: ceebaf8cc72f7047c3747f6ab27d6fb197523741 [file] [log] [blame]
Ulrich Weigandcac24ab2017-07-17 17:45:57 +00001// 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
5typedef __attribute__((vector_size(16))) signed char vec_schar;
6typedef __attribute__((vector_size(16))) signed short vec_sshort;
7typedef __attribute__((vector_size(16))) signed int vec_sint;
8typedef __attribute__((vector_size(16))) signed long long vec_slong;
9typedef __attribute__((vector_size(16))) unsigned char vec_uchar;
10typedef __attribute__((vector_size(16))) unsigned short vec_ushort;
11typedef __attribute__((vector_size(16))) unsigned int vec_uint;
12typedef __attribute__((vector_size(16))) unsigned long long vec_ulong;
13typedef __attribute__((vector_size(16))) double vec_double;
14typedef __attribute__((vector_size(16))) float vec_float;
15
16volatile vec_schar vsc;
17volatile vec_sshort vss;
18volatile vec_sint vsi;
19volatile vec_slong vsl;
20volatile vec_uchar vuc;
21volatile vec_ushort vus;
22volatile vec_uint vui;
23volatile vec_ulong vul;
24volatile vec_double vd;
25volatile vec_float vf;
26
27volatile unsigned int len;
28int cc;
29
30void test_integer(void) {
31 __builtin_s390_vmslg(vul, vul, vuc, -1); // expected-error {{argument should be a value from 0 to 15}}
32 __builtin_s390_vmslg(vul, vul, vuc, 16); // expected-error {{argument should be a value from 0 to 15}}
33 __builtin_s390_vmslg(vul, vul, vuc, len); // expected-error {{must be a constant integer}}
34}
35
36void test_float(void) {
37 __builtin_s390_vfmaxdb(vd, vd, -1); // expected-error {{argument should be a value from 0 to 15}}
38 __builtin_s390_vfmaxdb(vd, vd, 16); // expected-error {{argument should be a value from 0 to 15}}
39 __builtin_s390_vfmaxdb(vd, vd, len); // expected-error {{must be a constant integer}}
40 __builtin_s390_vfmindb(vd, vd, -1); // expected-error {{argument should be a value from 0 to 15}}
41 __builtin_s390_vfmindb(vd, vd, 16); // expected-error {{argument should be a value from 0 to 15}}
42 __builtin_s390_vfmindb(vd, vd, len); // expected-error {{must be a constant integer}}
43
44 __builtin_s390_vftcisb(vf, -1, &cc); // expected-error {{argument should be a value from 0 to 4095}}
45 __builtin_s390_vftcisb(vf, 4096, &cc); // expected-error {{argument should be a value from 0 to 4095}}
46 __builtin_s390_vftcisb(vf, len, &cc); // expected-error {{must be a constant integer}}
47
48 __builtin_s390_vfisb(vf, -1, 0); // expected-error {{argument should be a value from 0 to 15}}
49 __builtin_s390_vfisb(vf, 16, 0); // expected-error {{argument should be a value from 0 to 15}}
50 __builtin_s390_vfisb(vf, len, 0); // expected-error {{must be a constant integer}}
51 __builtin_s390_vfisb(vf, 0, -1); // expected-error {{argument should be a value from 0 to 15}}
52 __builtin_s390_vfisb(vf, 0, 16); // expected-error {{argument should be a value from 0 to 15}}
53 __builtin_s390_vfisb(vf, 0, len); // expected-error {{must be a constant integer}}
54
55 __builtin_s390_vfmaxsb(vf, vf, -1); // expected-error {{argument should be a value from 0 to 15}}
56 __builtin_s390_vfmaxsb(vf, vf, 16); // expected-error {{argument should be a value from 0 to 15}}
57 __builtin_s390_vfmaxsb(vf, vf, len); // expected-error {{must be a constant integer}}
58 __builtin_s390_vfminsb(vf, vf, -1); // expected-error {{argument should be a value from 0 to 15}}
59 __builtin_s390_vfminsb(vf, vf, 16); // expected-error {{argument should be a value from 0 to 15}}
60 __builtin_s390_vfminsb(vf, vf, len); // expected-error {{must be a constant integer}}
61}