Debian Codegraph @

gcc/testsuite/gdc.dg/Wbuiltin_declaration_mismatch3.d

raw
1 // { dg-additional-options "-mavx" { target avx_runtime } }
2 // { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
3 module gcc.simd;
4
5 alias int4 = __vector(int[4]);
6 alias short8 = __vector(short[8]);
7 alias float4 = __vector(float[4]);
8 alias byte16 = __vector(byte[16]);
9 struct fake4 { int[4] v; }
10 enum f = fake4();
11
12 void test_shuffle()
13 {
14 shuffle!(int, int, int)(0, 0, 0); // { dg-warning "mismatch in return type" }
15 shuffle!(double, int, int)(0, 0, 0); // { dg-warning "mismatch in return type" }
16 shuffle!(fake4, int, int)(f, 0, 0); // { dg-warning "mismatch in return type" }
17
18 shuffle!(int4, int, int)(0, 0, 0); // { dg-warning "mismatch in argument 2" }
19 shuffle!(int4, double, int)(0, 0, 0); // { dg-warning "mismatch in argument 2" }
20 shuffle!(int4, fake4, int)(0, f, 0); // { dg-warning "mismatch in argument 2" }
21
22 shuffle!(int4, int4, int)(0, 0, 0); // { dg-warning "mismatch in argument 3" }
23 shuffle!(int4, int4, double)(0, 0, 0); // { dg-warning "mismatch in argument 3" }
24 shuffle!(int4, int4, fake4)(0, 0, f); // { dg-warning "mismatch in argument 3" }
25
26 shuffle!(int4, int4, int4)(0, 0, 0);
27 shuffle!(int4, short8, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
28 shuffle!(int4, float4, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
29 shuffle!(int4, byte16, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
30 shuffle!(int4, int4, short8)(0, 0, 0); // { dg-error "mismatch in argument 3" }
31 shuffle!(int4, int4, float4)(0, 0, 0); // { dg-error "mismatch in argument 3" }
32 shuffle!(int4, int4, byte16)(0, 0, 0); // { dg-error "mismatch in argument 3" }
33
34 shuffle!(float4, int4, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
35 shuffle!(float4, short8, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
36 shuffle!(float4, float4, int4)(0, 0, 0);
37 shuffle!(float4, byte16, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
38 shuffle!(float4, float4, short8)(0, 0, 0); // { dg-error "mismatch in argument 3" }
39 shuffle!(float4, float4, float4)(0, 0, 0); // { dg-error "mismatch in argument 3" }
40 shuffle!(float4, float4, byte16)(0, 0, 0); // { dg-error "mismatch in argument 3" }
41
42 shuffle!(short8, int4, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
43 shuffle!(short8, short8, int4)(0, 0, 0); // { dg-error "mismatch in argument 3" }
44 shuffle!(short8, float4, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
45 shuffle!(short8, byte16, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
46 shuffle!(short8, short8, short8)(0, 0, 0);
47 shuffle!(short8, short8, float4)(0, 0, 0); // { dg-error "mismatch in argument 3" }
48 shuffle!(short8, short8, byte16)(0, 0, 0); // { dg-error "mismatch in argument 3" }
49
50 shuffle!(byte16, int4, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
51 shuffle!(byte16, short8, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
52 shuffle!(byte16, float4, int4)(0, 0, 0); // { dg-error "mismatch in argument 2" }
53 shuffle!(byte16, byte16, int4)(0, 0, 0); // { dg-error "mismatch in argument 3" }
54 shuffle!(byte16, byte16, short8)(0, 0, 0); // { dg-error "mismatch in argument 3" }
55 shuffle!(byte16, byte16, float4)(0, 0, 0); // { dg-error "mismatch in argument 3" }
56 shuffle!(byte16, byte16, byte16)(0, 0, 0);
57 }
58
59 // The following declarations of the simd intrinsics are without any guards
60 // to verify `d/intrinsics.cc` is doing checks to prevent invalid lowerings.
61 V0 shuffle(V0, V1, M)(V0, V1, M);