1/* { dg-do run } */ 2/* { dg-require-effective-target avx } */ 3/* { dg-options "-O2 -mavx -mvzeroupper" } */ 4 5#include "avx-check.h" 6 7int s[8] = {1, 2, 3, 4, 5, 6, 7, 8}; 8int d[8] = {11, 22, 33, 44, 55, 66, 77, 88}; 9 10void 11__attribute__((noinline)) 12foo () 13{ 14 int i; 15 for (i = 0; i < ARRAY_SIZE (d); i++) 16 d[i] = s[i] + 0x1000; 17} 18 19static void 20__attribute__((noinline)) 21bar (__m256i src) 22{ 23 foo (); 24 _mm256_storeu_si256 ((__m256i*) d, src); 25 if (__builtin_memcmp (d, s, sizeof (d))) 26 abort (); 27} 28 29static void 30avx_test (void) 31{ 32 __m256i src = _mm256_loadu_si256 ((__m256i*) s); 33 bar (src); 34} 35