Debian Codegraph @

gcc/testsuite/gdc.test/runnable_cxx/extra-files/test20652.cpp

raw
1 #include <assert.h>
2
3 // Inline the typedef of __m128 instead of including immintrin.h.
4 #if defined(__GNUC__) || defined(__clang__)
5 typedef float __m128 __attribute__((__vector_size__(16), __may_alias__));
6
7 #elif defined(_MSC_VER)
8 typedef union __declspec(intrin_type) __declspec(align(16)) __m128 {
9 float m128_f32[4];
10 } __m128;
11
12 #else
13 #error "Unknown vendor"
14 #endif
15
16 void test20652(const __m128& a)
17 {
18 union
19 {
20 __m128 value;
21 float array[4];
22 } b;
23 b.value = a;
24
25 assert(b.array[0] == 1);
26 assert(b.array[1] == 1);
27 assert(b.array[2] == 1);
28 assert(b.array[3] == 1);
29 }