Debian Codegraph @

gcc/testsuite/gcc.dg/torture/bitint-65.c

raw
1 /* PR libgcc/114397 */
2 /* { dg-do run { target bitint } } */
3 /* { dg-options "-std=c23" } */
4 /* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */
5 /* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
6
7 #if __BITINT_MAXWIDTH__ >= 129
8 int
9 foo (unsigned _BitInt (128) a, _BitInt (129) b)
10 {
11 return a / b;
12 }
13 #endif
14
15 #if __BITINT_MAXWIDTH__ >= 192
16 int
17 bar (unsigned _BitInt (128) a, _BitInt (192) b)
18 {
19 return a / b;
20 }
21 #endif
22
23 int
24 main ()
25 {
26 #if __BITINT_MAXWIDTH__ >= 129
27 if (foo (336225022742818342628768636932743029911uwb,
28 -336225022742818342628768636932743029911wb) != -1
29 || foo (336225022742818342628768636932743029912uwb,
30 -336225022742818342628768636932743029911wb) != -1
31 || foo (336225022742818342628768636932743029911uwb,
32 -336225022742818342628768636932743029912wb) != 0)
33 __builtin_abort ();
34 #endif
35 #if __BITINT_MAXWIDTH__ >= 192
36 if (bar (336225022742818342628768636932743029911uwb,
37 -336225022742818342628768636932743029911wb) != -1
38 || bar (336225022742818342628768636932743029912uwb,
39 -336225022742818342628768636932743029911wb) != -1
40 || bar (336225022742818342628768636932743029911uwb,
41 -336225022742818342628768636932743029912wb) != 0)
42 __builtin_abort ();
43 #endif
44 }