Debian Codegraph @

gcc/testsuite/gdc.dg/Wbuiltin_declaration_mismatch2.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_load_store()
13 {
14 loadUnaligned!int(null); // { dg-warning "mismatch in return type" }
15 loadUnaligned!double(null); // { dg-warning "mismatch in return type" }
16 loadUnaligned!int4(null);
17 loadUnaligned!short8(null);
18 loadUnaligned!float4(null);
19 loadUnaligned!byte16(null);
20 loadUnaligned!fake4(null); // { dg-warning "mismatch in return type" }
21
22 storeUnaligned!int(null, 1); // { dg-warning "mismatch in return type" }
23 storeUnaligned!double(null, 1); // { dg-warning "mismatch in return type" }
24 storeUnaligned!int4(null, 1);
25 storeUnaligned!short8(null, 1);
26 storeUnaligned!float4(null, 1);
27 storeUnaligned!byte16(null, 1);
28 storeUnaligned!fake4(null, f); // { dg-warning "mismatch in return type" }
29 }
30
31 // The following declarations of the simd intrinsics are without any guards
32 // to verify `d/intrinsics.cc` is doing checks to prevent invalid lowerings.
33 V loadUnaligned(V)(const V*);
34 V storeUnaligned(V)(V*, V);