aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/bitint-58.c
blob: 4368788590f6f57ceb57d76fcf9ac060ca07cfa8 (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
30
31
/* PR tree-optimization/113102 */
/* { dg-do compile { target bitint } } */
/* { dg-options "-std=c23 -O2" } */

_BitInt(3) a;
#if __BITINT_MAXWIDTH__ >= 4097
_BitInt(8) b;
_BitInt(495) c;
_BitInt(513) d;
_BitInt(1085) e;
_BitInt(4096) f;

void
foo (void)
{
  a -= (_BitInt(4097)) d >> b;
}

void
bar (void)
{
  __builtin_sub_overflow ((_BitInt(767)) c >> e, 0, &a);
}

void
baz (void)
{
  _BitInt(768) x = (_BitInt(257))f;
  b /= x >> 0 / 0;	/* { dg-warning "division by zero" } */
}
#endif