Debian Codegraph @

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

raw
1 /* PR c/102989 */
2 /* { dg-do run { target bitint } } */
3 /* { dg-options "-std=c23 -pedantic-errors" } */
4 /* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */
5 /* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
6
7 #if __BITINT_MAXWIDTH__ >= 135
8 __attribute__((noipa)) _BitInt(135)
9 test_135 (_BitInt(135) x)
10 {
11 return x;
12 }
13 #endif
14
15 #if __BITINT_MAXWIDTH__ >= 192
16 __attribute__((noipa)) unsigned _BitInt(192)
17 test_192 (unsigned _BitInt(192) x)
18 {
19 return x;
20 }
21 #endif
22
23 #if __BITINT_MAXWIDTH__ >= 575
24 __attribute__((noipa)) _BitInt(575)
25 test_575 (_BitInt(575) x)
26 {
27 return x;
28 }
29 #endif
30
31 int
32 main ()
33 {
34 #if __BITINT_MAXWIDTH__ >= 135
35 if (test_135 (-3544625980220396993429741165699996713118wb)
36 != -3544625980220396993429741165699996713118wb)
37 __builtin_abort ();
38 if (test_135 (2169804wb) != 2169804wb)
39 __builtin_abort ();
40 #endif
41 #if __BITINT_MAXWIDTH__ >= 192
42 if (test_192 (3548247468860296534428690122730090696161878417599647607527uwb)
43 != 3548247468860296534428690122730090696161878417599647607527uwb)
44 __builtin_abort ();
45 if (test_192 (2169804wb) != 2169804wb)
46 __builtin_abort ();
47 #endif
48 #if __BITINT_MAXWIDTH__ >= 575
49 if (test_575 (-33874713055088145128482141398907153733216500583643955589065159154103468056485975553675944430696955474989655597693729139818286384955989466009330817447458608627989731550807841wb)
50 != -33874713055088145128482141398907153733216500583643955589065159154103468056485975553675944430696955474989655597693729139818286384955989466009330817447458608627989731550807841wb)
51 __builtin_abort ();
52 if (test_575 (-3433547832854987708194667330190358661244810661613962474981319303539871wb)
53 != -3433547832854987708194667330190358661244810661613962474981319303539871wb)
54 __builtin_abort ();
55 if (test_575 (-49693319wb) != -49693319wb)
56 __builtin_abort ();
57 if (test_575 (57563058931861084391041643822550577259264793697002277417254009715684553274763772399490655207001200602249198262962055591804634113396033194657392511369609233430583407788096333wb)
58 != 57563058931861084391041643822550577259264793697002277417254009715684553274763772399490655207001200602249198262962055591804634113396033194657392511369609233430583407788096333wb)
59 __builtin_abort ();
60 if (test_575 (158093724114624905837287422406159616673122916308832353wb)
61 != 158093724114624905837287422406159616673122916308832353wb)
62 __builtin_abort ();
63 if (test_575 (3807354285642wb) != 3807354285642wb)
64 __builtin_abort ();
65 #endif
66 }