summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr53416.c
blob: 68abe8bddbc9dcd29f6b963554378dcaa2201124 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR target/53416 */
/* { dg-options "-O2 -mrdrnd" } */

int test (void)
{
  unsigned int number = 0;
  int result0, result1, result2, result3;

  result0 = __builtin_ia32_rdrand32_step (&number);
  result1 = __builtin_ia32_rdrand32_step (&number);
  result2 = __builtin_ia32_rdrand32_step (&number);
  result3 = __builtin_ia32_rdrand32_step (&number);

  return result0 + result1 +result2 + result3;
}

/* { dg-final { scan-assembler-times "rdrand" 4 } } */