aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/bitint-123.c
blob: 4d019a98fdfc76fea3cbefe48e8fe975853c9a14 (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
/* PR middle-end/120547 */
/* { dg-do run { target bitint } } */
/* { dg-options "-O2" } */
/* { dg-add-options float64 } */
/* { dg-require-effective-target float64 } */

#define CHECK(x, y) \
  if ((_Float64) x != (_Float64) y				\
      || (_Float64) (x + 1) != (_Float64) (y + 1))		\
    __builtin_abort ()

int
main ()
{
  unsigned long long a = 0x20000000000001ULL << 7;
  volatile unsigned long long b = a;
  CHECK (a, b);
#if __BITINT_MAXWIDTH__ >= 4096
  unsigned _BitInt(4096) c = ((unsigned _BitInt(4096)) 0x20000000000001ULL) << 253;
  volatile unsigned _BitInt(4096) d = c;
  CHECK (c, d);
  unsigned _BitInt(4096) e = ((unsigned _BitInt(4096)) 0x20000000000001ULL) << 931;
  volatile unsigned _BitInt(4096) f = e;
  CHECK (e, f);
#endif
}