Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr83735.c
blob786c90a583949825ec4fe1bf962260f923c7fe36
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx } */
3 /* { dg-options "-O3 -mavx" } */
5 #include <stdlib.h>
6 #include "cpuid.h"
7 #include "m256-check.h"
8 #include "avx-os-support.h"
10 static void __attribute__((constructor))
11 check_avx (void)
13 unsigned int eax, ebx, ecx, edx;
15 if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
16 exit (0);
18 /* Run AVX test only if host has AVX support. */
19 if (((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
20 && avx_os_support ())
21 return;
23 exit (0);
26 struct S
28 short b;
29 long c;
30 char d;
31 long e;
32 unsigned:8;
35 int f, h, k, l;
36 int g[10];
37 volatile struct S j;
38 char m;
40 int
41 main (void)
43 int i;
44 struct S n;
45 for (i = 0; i < 6; i++)
47 for (f = 0; f < 10; f++)
48 g[f] = 4;
49 n = j;
50 h = m == 0 ? 1 : 5 % m;
51 if (l)
52 n.b = k;
54 return n.b;