summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c
blob: 4272dc3cd0d959ab2ca4b85633d758d24046c94f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* { dg-do run } */
/* { dg-require-effective-target avx } */
/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store" } */

#include "avx-check.h"

#define N 128

char **ep;
char **fp;

__attribute__ ((noinline))
void
foo (void)
{
  ep = (char **) malloc (N);
  fp = (char **) malloc (N);
}

void
avx_test (void)
{
  int i;
  char **ap, **bp;
  char *str = "STR";

  foo ();

  ap = ep;
  bp = fp;

  for (i = N; i >= 0; i--)
    {
      *ap++ = str;
      *bp++ = str;
    }

  for (i = N; i >= 0; i--)
    {
      if (strcmp (*--ap, "STR") != 0)
	abort ();
      if (strcmp (*--bp, "STR") != 0)
	abort ();
    }
}