PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-pr77476.c
blobf3bd509535a9cd668c7851ac4f636f4e8e692df0
1 /* PR target/77476 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -mavx512f" } */
4 /* { dg-require-effective-target avx512f } */
6 #ifndef PR77476_TEST
7 #include "avx512f-check.h"
8 #define PR77476_TEST avx512f_test
9 #endif
11 unsigned short s;
12 unsigned int i;
13 unsigned long long l;
15 void
16 f1 (void)
18 unsigned char a = 0xff;
19 asm volatile ("" : "+Yk" (a));
20 s = a;
23 void
24 f2 (void)
26 unsigned char a = 0xff;
27 asm volatile ("" : "+Yk" (a));
28 i = a;
31 void
32 f3 (void)
34 unsigned char a = 0xff;
35 asm volatile ("" : "+Yk" (a));
36 l = a;
39 void
40 f4 (void)
42 unsigned short a = 0xffff;
43 asm volatile ("" : "+Yk" (a));
44 i = a;
47 void
48 f5 (void)
50 unsigned short a = 0xffff;
51 asm volatile ("" : "+Yk" (a));
52 l = a;
55 #ifdef __AVX512BW__
56 void
57 f6 (void)
59 unsigned int a = 0xffffffff;
60 asm volatile ("" : "+Yk" (a));
61 l = a;
63 #endif
65 static void
66 PR77476_TEST ()
68 f1 (); if (s != 0xff) __builtin_abort (); s = 0;
69 f2 (); if (i != 0xff) __builtin_abort (); i = 0;
70 f3 (); if (l != 0xff) __builtin_abort (); l = 0;
71 f4 (); if (i != 0xffff) __builtin_abort (); i = 0;
72 f5 (); if (l != 0xffff) __builtin_abort (); l = 0;
73 #ifdef __AVX512BW__
74 f6 (); if (l != 0xffffffff) __builtin_abort (); l = 0;
75 #endif