]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/bitint-3.c
testsuite: Refer more consistently to C23 not C2X
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / bitint-3.c
1 /* PR c/102989 */
2 /* { dg-do compile { target bitint } } */
3 /* { dg-options "-std=c23 -pedantic-errors" } */
4
5 _BitInt(32) a, b = 2147483647wb;
6 _BitInt(64) c, d = 9223372036854775807wb;
7 struct S {
8 _BitInt(2) a;
9 _BitInt(6) b;
10 } s, t = { -1wb - 1wb, 31wb };
11
12 void
13 foo (void)
14 {
15 a = b;
16 c = d;
17 s.a = t.a;
18 s.b = t.b;
19 }
20
21 void
22 bar (void)
23 {
24 a += b;
25 c += d;
26 s.a += t.a;
27 s.b += t.b;
28 }
29
30 #if __BITINT_MAXWIDTH__ >= 128
31 unsigned _BitInt(128) e = 340282366920938463463374607431768211455uwb;
32 _BitInt(128) f = 20000000000000000000000000000000000000wb;
33 _BitInt(128) g = -20000000000000000000000000000000000000wb;
34 #endif
35
36 #if __BITINT_MAXWIDTH__ >= 575
37 unsigned _BitInt(575) h = 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb;
38 _BitInt(575) i = 2000000000000000000000000000000000000000000wb;
39 _BitInt(575) j = -2000000000000000000000000000000000000000000wb;
40 #endif