2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr67995-3.c
blob11993b74af7d8ef296b64de75a3af6970b2b0731
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -march=core2" } */
4 unsigned int
5 __attribute__ ((target("rdrnd")))
6 __x86_rdrand(void)
8 unsigned int retries = 100;
9 unsigned int val;
11 while (__builtin_ia32_rdrand32_step(&val) == 0)
12 if (--retries == 0)
13 return 0;
15 return val;