aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/builtins-pr107565.c
blob: fb340aa5981bde2ae7be39c0f96f5fc16a101a87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* { dg-do compile { target { x86_64-*-* && lp64 } } } */
/* { dg-additional-options "-mrdrnd" } */

unsigned short
hardware_rand16 (void)
{
  unsigned short x;
  while (! __builtin_ia32_rdrand16_step (&x))
    continue;
  return x; /* { dg-bogus "uninit" } */
}

unsigned int
hardware_rand32 (void)
{
  unsigned int x;
  while (! __builtin_ia32_rdrand32_step (&x))
    continue;
  return x; /* { dg-bogus "uninit" } */
}

unsigned long long
hardware_rand64 (void)
{
  unsigned long long int x;
  while (! __builtin_ia32_rdrand64_step (&x))
    continue;
  return x; /* { dg-bogus "uninit" } */
}