libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / bitint-65.c
blobb7724d05382c101926450999028cb9cb4628e3eb
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" } { "" } } */
7 #if __BITINT_MAXWIDTH__ >= 129
8 int
9 foo (unsigned _BitInt (128) a, _BitInt (129) b)
11 return a / b;
13 #endif
15 #if __BITINT_MAXWIDTH__ >= 192
16 int
17 bar (unsigned _BitInt (128) a, _BitInt (192) b)
19 return a / b;
21 #endif
23 int
24 main ()
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