]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/torture/bitint-25.c
testsuite: Refer more consistently to C23 not C2X
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / torture / bitint-25.c
1 /* PR c/102989 */
2 /* { dg-do run { target { bitint && float16_runtime } } } */
3 /* { dg-options "-std=gnu23" } */
4 /* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */
5 /* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
6 /* { dg-add-options float16 } */
7
8 int
9 main ()
10 {
11 #if __FLT16_MANT_DIG__ == 11
12 static volatile _Float16 s[] = {
13 0.0F16,
14 42.0F16,
15 -65504.0F16,
16 65504.0F16
17 };
18 static volatile _Float16 u[] = {
19 0.0F16,
20 1.0F16,
21 178.0F16,
22 65504.0F16
23 };
24 #if __BITINT_MAXWIDTH__ >= 135
25 static volatile _BitInt(135) s_135[] = {
26 0wb,
27 42wb,
28 -65504wb,
29 65504wb
30 };
31 static volatile unsigned _BitInt(135) u_135[] = {
32 0uwb,
33 1uwb,
34 178uwb,
35 65504uwb
36 };
37 for (int i = 0; i < 4; ++i)
38 {
39 if (s[i] != (_Float16) s_135[i]
40 || u[i] != (_Float16) u_135[i]
41 || (_BitInt(135)) s[i] != s_135[i]
42 || (unsigned _BitInt(135)) u[i] != u_135[i])
43 __builtin_abort ();
44 }
45 #endif
46 #if __BITINT_MAXWIDTH__ >= 192
47 static volatile _BitInt(192) s_192[] = {
48 0wb,
49 42wb,
50 -65504wb,
51 65504wb
52 };
53 static volatile unsigned _BitInt(192) u_192[] = {
54 0uwb,
55 1uwb,
56 178uwb,
57 65504uwb
58 };
59 for (int i = 0; i < 4; ++i)
60 {
61 if (s[i] != (_Float16) s_192[i]
62 || u[i] != (_Float16) u_192[i]
63 || (_BitInt(192)) s[i] != s_192[i]
64 || (unsigned _BitInt(192)) u[i] != u_192[i])
65 __builtin_abort ();
66 }
67 #endif
68 #if __BITINT_MAXWIDTH__ >= 575
69 static volatile _BitInt(575) s_575[] = {
70 0wb,
71 42wb,
72 -65504wb,
73 65504wb
74 };
75 static volatile unsigned _BitInt(575) u_575[] = {
76 0uwb,
77 1uwb,
78 178uwb,
79 65504uwb
80 };
81 for (int i = 0; i < 4; ++i)
82 {
83 if (s[i] != (_Float16) s_575[i]
84 || u[i] != (_Float16) u_575[i]
85 || (_BitInt(575)) s[i] != s_575[i]
86 || (unsigned _BitInt(575)) u[i] != u_575[i])
87 __builtin_abort ();
88 }
89 #endif
90 #endif
91 }