Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx2-pr108599.c

raw
1 /* PR target/108599 */
2 /* { dg-do run { target avx2 } } */
3 /* { dg-options "-O2 -mavx2 -mtune=skylake-avx512" } */
4
5 #include "avx2-check.h"
6
7 struct S { unsigned long long a, b, c, d; };
8
9 __attribute__((noipa)) void
10 foo (unsigned long long x, unsigned long long y,
11 unsigned long long z, unsigned long long w, const struct S s)
12 {
13 if (s.a != x || s.b != y || s.c != z || s.d != w)
14 abort ();
15 }
16
17 typedef unsigned long long V __attribute__((may_alias, vector_size (4 * sizeof (unsigned long long))));
18
19 static void
20 avx2_test (void)
21 {
22 {
23 struct S s;
24 *(V *)&s = (V) { 16, 0, 0, 0 };
25 foo (16, 0, 0, 0, s);
26 }
27 {
28 struct S s;
29 *(V *)&s = (V) { 16, 16, 0, 0 };
30 foo (16, 16, 0, 0, s);
31 }
32 }