PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / bmi2-sarx32-1.c
blob8224b6f60de148534686d1591123e91aebba4422
1 /* { dg-do run { target { bmi2 } } } */
2 /* { dg-options "-mbmi2 -O2 -dp" } */
4 #include "bmi2-check.h"
6 __attribute__((noinline))
7 int
8 calc_sarx_u32 (int a, int l)
10 int volatile res = a;
11 int i;
12 for (i = 0; i < l; ++i)
13 res >>= 1;
15 return res;
18 static void
19 bmi2_test ()
21 unsigned i;
22 int src = 0xfce7ace0;
23 int res, res_ref;
25 for (i = 0; i < 5; ++i) {
26 src = src * (i + 1);
28 res_ref = calc_sarx_u32 (src, i + 1);
29 res = src >> (i + 1);
31 if (res != res_ref)
32 abort();