aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2-error.c
blob: 0f2841d99c3ac2dd6bcfe1c9b23fdf7fa7c194b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// REQUIRES: systemz-registered-target
// RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \
// RUN: -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s

#include <vecintrin.h>

volatile vector signed char vsc;
volatile vector signed short vss;
volatile vector signed int vsi;
volatile vector signed long long vsl;
volatile vector signed __int128 vslll;
volatile vector unsigned char vuc;
volatile vector unsigned short vus;
volatile vector unsigned int vui;
volatile vector unsigned long long vul;
volatile vector unsigned __int128 vulll;
volatile vector bool char vbc;
volatile vector bool short vbs;
volatile vector bool int vbi;
volatile vector bool long long vbl;
volatile vector float vf;
volatile vector double vd;

volatile signed char sc;
volatile signed short ss;
volatile signed int si;
volatile signed long long sl;
volatile unsigned char uc;
volatile unsigned short us;
volatile unsigned int ui;
volatile unsigned long long ul;
volatile float f;
volatile double d;

const void * volatile cptr;
const signed char * volatile cptrsc;
const signed short * volatile cptrss;
const signed int * volatile cptrsi;
const signed long long * volatile cptrsl;
const unsigned char * volatile cptruc;
const unsigned short * volatile cptrus;
const unsigned int * volatile cptrui;
const unsigned long long * volatile cptrul;
const float * volatile cptrf;
const double * volatile cptrd;

void * volatile ptr;
signed char * volatile ptrsc;
signed short * volatile ptrss;
signed int * volatile ptrsi;
signed long long * volatile ptrsl;
unsigned char * volatile ptruc;
unsigned short * volatile ptrus;
unsigned int * volatile ptrui;
unsigned long long * volatile ptrul;
float * volatile ptrf;
double * volatile ptrd;

volatile unsigned int len;
volatile int idx;
int cc;

void test_core(void) {
  vf = vec_gather_element(vf, vui, cptrf, idx);    // expected-error {{no matching function}}
                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vf = vec_gather_element(vf, vui, cptrf, -1);     // expected-error {{no matching function}}
                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vf = vec_gather_element(vf, vui, cptrf, 4);      // expected-error {{no matching function}}
                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vd = vec_gather_element(vd, vul, cptrd, idx);    // expected-error {{no matching function}}
                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}
  vd = vec_gather_element(vd, vul, cptrd, -1);     // expected-error {{no matching function}}
                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}
  vd = vec_gather_element(vd, vul, cptrd, 2);      // expected-error {{no matching function}}
                                                   // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                                   // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}

  vec_scatter_element(vf, vui, ptrf, idx);   // expected-error {{no matching function}}
                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vec_scatter_element(vf, vui, ptrf, -1);    // expected-error {{no matching function}}
                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vec_scatter_element(vf, vui, ptrf, 4);     // expected-error {{no matching function}}
                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vec_scatter_element(vd, vul, ptrd, idx);   // expected-error {{no matching function}}
                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}
  vec_scatter_element(vd, vul, ptrd, -1);    // expected-error {{no matching function}}
                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}
  vec_scatter_element(vd, vul, ptrd, 2);     // expected-error {{no matching function}}
                                             // expected-note@vecintrin.h:* 7 {{candidate function not viable}}
                                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}

  vf = vec_splat(vf, idx);   // expected-error {{no matching function}}
                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vf = vec_splat(vf, -1);    // expected-error {{no matching function}}
                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vf = vec_splat(vf, 4);     // expected-error {{no matching function}}
                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 3}}
  vd = vec_splat(vd, idx);   // expected-error {{no matching function}}
                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}
  vd = vec_splat(vd, -1);    // expected-error {{no matching function}}
                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}
  vd = vec_splat(vd, 2);     // expected-error {{no matching function}}
                             // expected-note@vecintrin.h:* 13 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 1}}
}

void test_integer(void) {
  vf = vec_sld(vf, vf, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}}
                             // expected-note@vecintrin.h:* 15 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}
  vd = vec_sld(vd, vd, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}}
                             // expected-note@vecintrin.h:* 15 {{candidate function not viable}}
                             // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}

  vulll = vec_msum(vul, vul, vulll, idx);   // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vmslg' must be a constant integer}}
                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}
  vulll = vec_msum(vul, vul, vulll, -1);    // expected-error {{no matching function}} expected-error {{argument value -1 is outside the valid range [0, 15]}}
                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}
  vulll = vec_msum(vul, vul, vulll, 16);    // expected-error {{no matching function}} expected-error {{argument value 16 is outside the valid range [0, 15]}}
                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}

  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}}
                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}
  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]}}
                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}
  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]}}
                                            // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 15}}
}

void test_float(void) {
  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}}
                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}
                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}
  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]}}
                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}
                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}
  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]}}
                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}
                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}
  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}}
                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}
                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}
  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]}}
                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}
                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}
  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]}}
                                               // expected-note@vecintrin.h:* 1 {{candidate function not viable}}
                                               // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 4095}}
}