Debian Codegraph @

gcc/testsuite/gcc.dg/bitint-86.c

raw
1 /* PR tree-optimization/113736 */
2 /* { dg-do compile { target bitint } } */
3 /* { dg-options "-O2 -std=gnu23 -w" } */
4
5 #if __BITINT_MAXWIDTH__ >= 710
6 struct S { _BitInt(710) a; };
7 struct T { struct S b[4]; };
8
9 #ifdef __x86_64__
10 #define SEG __seg_gs
11 #elif defined __i386__
12 #define SEG __seg_fs
13 #else
14 #define SEG
15 #endif
16
17 void
18 foo (SEG struct T *p)
19 {
20 struct S s;
21 p->b[0] = s;
22 }
23
24 void
25 bar (SEG struct T *p, _BitInt(710) x, int y, double z)
26 {
27 p->b[0].a = x + 42;
28 p->b[1].a = x << y;
29 p->b[2].a = x >> y;
30 p->b[3].a = z;
31 }
32
33 int
34 baz (SEG struct T *p, _BitInt(710) x, _BitInt(710) y)
35 {
36 return __builtin_add_overflow (x, y, &p->b[1].a);
37 }
38 #else
39 int i;
40 #endif