1 /* Test whether overloading works as expected. */
2
3 /* { dg-do compile { target { s390*-*-* } } } */
4 /* { dg-options "-march=z13 -mzarch -mzvector" } */
5
6 __vector int v4si;
7 __vector unsigned uv4si;
8 __vector bool bv4si;
9 __vector long long v2di;
10 __vector unsigned long long uv2di;
11 __vector bool long long bv2di;
12 __vector double v2df;
13 int *intptr;
14 unsigned *uintptr;
15 double *dblptr;
16 long long ll;
17 unsigned long long ull;
18 const int *cintptr;
19 long long* llptr;
20 unsigned long long* ullptr;
21
22 void
foo()23 foo ()
24 {
25 __builtin_s390_vec_scatter_element (v4si, uv4si, (int*)0, 0); /* ok */
26 __builtin_s390_vec_insert_and_zero (intptr); /* ok */
27
28 /* The unsigned pointer must not match the signed pointer. */
29 __builtin_s390_vec_scatter_element (v4si, uv4si, uintptr, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
30
31 /* Make sure signed int pointers don't match unsigned int pointers. */
32 __builtin_s390_vec_scatter_element (bv4si, uv4si, intptr, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
33
34 /* Const pointers do not match unqualified operands. */
35 __builtin_s390_vec_scatter_element (v4si, uv4si, cintptr, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
36
37 /* Volatile pointers do not match unqualified operands. */
38 __builtin_s390_vec_scatter_element (v4si, uv4si, cintptr, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
39
40 /* The third operands needs to be double *. */
41 __builtin_s390_vec_scatter_element (v2df, uv4si, intptr, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
42
43 /* This is an ambigious overload. */
44 __builtin_s390_vec_scatter_element (v4si, uv4si, 0, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
45
46 /* Pointer to vector must not match. */
47 __builtin_s390_vec_scatter_element (v4si, uv4si, &v4si, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
48
49 /* Don't accept const int* for int*. */
50 __builtin_s390_vec_scatter_element (v4si, uv4si, cintptr, 0); /* { dg-error "invalid parameter combination for intrinsic" } */
51
52 __builtin_s390_vec_load_pair (ll, ull); /* { dg-error "ambiguous overload for intrinsic" } */
53 __builtin_s390_vec_load_pair (ull, ll); /* { dg-error "ambiguous overload for intrinsic" } */
54 }
55