]>
Commit | Line | Data |
---|---|---|
a2f50aa2 JJ |
1 | /* PR c/102989 */ |
2 | /* { dg-do run { target bitint } } */ | |
54bac0ce | 3 | /* { dg-options "-O2 -std=c23 -pedantic-errors" } */ |
a2f50aa2 JJ |
4 | |
5 | #if __BITINT_MAXWIDTH__ >= 192 | |
6 | __attribute__((noipa)) _BitInt(192) | |
7 | tests192 (_Decimal128 d) | |
8 | { | |
9 | return d; | |
10 | } | |
11 | ||
12 | __attribute__((noipa)) unsigned _BitInt(192) | |
13 | testu192 (_Decimal128 d) | |
14 | { | |
15 | return d; | |
16 | } | |
17 | #endif | |
18 | ||
19 | #if __BITINT_MAXWIDTH__ >= 575 | |
20 | __attribute__((noipa)) _BitInt(575) | |
21 | tests575 (_Decimal128 d) | |
22 | { | |
23 | return d; | |
24 | } | |
25 | ||
26 | __attribute__((noipa)) unsigned _BitInt(575) | |
27 | testu575 (_Decimal128 d) | |
28 | { | |
29 | return d; | |
30 | } | |
31 | #endif | |
32 | ||
33 | int | |
34 | main () | |
35 | { | |
36 | #if __BITINT_MAXWIDTH__ >= 192 | |
37 | if (tests192 (0.DL) != 0wb | |
38 | || tests192 (0.9999999999999999999999999999999999DL) != 0wb | |
39 | || tests192 (7.999999999999999999999999999999999DL) != 7wb | |
c62c82dc JJ |
40 | || tests192 (-0.DL) != 0wb |
41 | || tests192 (-0.9999999999999999999999999999999999DL) != 0wb | |
42 | || tests192 (-1.DL) != -1wb | |
a2f50aa2 JJ |
43 | || tests192 (-42.5DL) != -42wb |
44 | || tests192 (-34242319854.45429439857871298745432e+27DL) != -34242319854454294398578712987454320000wb | |
45 | || tests192 (-213855087769445.9e+43DL) != -2138550877694459000000000000000000000000000000000000000000wb | |
46 | || tests192 (3138550867693340381917894711603833.0e+24DL) != 3138550867693340381917894711603833000000000000000000000000wb | |
47 | || tests192 (-3138550867693340381917894711603833.0e+24DL) != -3138550867693340381917894711603833000000000000000000000000wb) | |
48 | __builtin_abort (); | |
49 | if (tests192 (3138550867693340381917894711603834.0e+24DL) != 3138550867693340381917894711603833208051177722232017256447wb | |
50 | || tests192 (9999999999999999999999999999999999e+6111DL) != 3138550867693340381917894711603833208051177722232017256447wb | |
51 | || tests192 (-3138550867693340381917894711603834.0e+24DL) != -3138550867693340381917894711603833208051177722232017256447wb - 1wb | |
52 | || tests192 (-9999999999999999999999999999999999e+6111DL) != -3138550867693340381917894711603833208051177722232017256447wb - 1wb) | |
53 | __builtin_abort (); | |
54 | if (testu192 (0.DL) != 0uwb | |
55 | || testu192 (0.9999999999999999999999999999999999DL) != 0uwb | |
56 | || testu192 (-0.9999999999999999999999999999999999DL) != 0uwb | |
c62c82dc JJ |
57 | || testu192 (-0.DL) != 0uwb |
58 | || testu192 (-0.9999999999999999999999DL) != 0uwb | |
a2f50aa2 JJ |
59 | || testu192 (-0.5DL) != 0uwb |
60 | || testu192 (42.99999999999999999999999999999999DL) != 42uwb | |
61 | || testu192 (42.e+21DL) != 42000000000000000000000uwb | |
62 | || testu192 (34242319854.45429439857871298745432e+21DL) != 34242319854454294398578712987454uwb | |
63 | || testu192 (6277101735386680763835789423207666.0e+24DL) != 6277101735386680763835789423207666000000000000000000000000uwb) | |
64 | __builtin_abort (); | |
65 | if (testu192 (-1.DL) != 0uwb | |
66 | || testu192 (-42.5e+15DL) != 0uwb | |
67 | || testu192 (-9999999999999999999999999999999999e+6111DL) != 0uwb | |
68 | || testu192 (6277101735386680763835789423207667.0e+24DL) != 6277101735386680763835789423207666416102355444464034512895uwb | |
69 | || testu192 (9999999999999999999999999999999999e+6111DL) != 6277101735386680763835789423207666416102355444464034512895uwb) | |
70 | __builtin_abort (); | |
71 | #endif | |
72 | #if __BITINT_MAXWIDTH__ >= 575 | |
73 | if (tests575 (0.DL) != 0wb | |
74 | || tests575 (0.999999999999999999999DL) != 0wb | |
75 | || tests575 (12.99999999999999999999999999999DL) != 12wb | |
c62c82dc JJ |
76 | || tests575 (-0.0000000000DL) != 0wb |
77 | || tests575 (-0.9999999999999999999999999999999999DL) != 0uwb | |
78 | || tests575 (-1.DL) != -1wb | |
a2f50aa2 JJ |
79 | || tests575 (-89.5DL) != -89wb |
80 | || tests575 (-34242319854.45429986754986758972345e+37DL) != -342423198544542998675498675897234500000000000000wb | |
81 | || tests575 (-518326003682761.2e+158DL) != -51832600368276120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb | |
82 | || tests575 (6183260036827613351512563025491179.0e+139DL) != 61832600368276133515125630254911790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb | |
83 | || tests575 (-6183260036827613351512563025491179.0e+139DL) != -61832600368276133515125630254911790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb) | |
84 | __builtin_abort (); | |
85 | if (tests575 (618326003682761335151256302549118.0e+140DL) != 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb | |
86 | || tests575 (9999999999999999999999999999999999e+6111DL) != 61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb | |
87 | || tests575 (-6183260036827613351512563025491180.0e+139DL) != -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb | |
88 | || tests575 (-9999999999999999999999999999999999e+6111DL) != -61832600368276133515125630254911797508782837275302959978515764023224306276632966792579100265310761247399417856504034834837841258576687802491886538775473291979151693037174783wb - 1wb) | |
89 | __builtin_abort (); | |
90 | if (testu575 (0.DL) != 0uwb | |
91 | || testu575 (0.5555555555555555555555555555555555DL) != 0uwb | |
92 | || testu575 (-0.7777777777777777777777777777777777DL) != 0uwb | |
93 | || testu575 (-0.99DL) != 0uwb | |
c62c82dc | 94 | || testu575 (-0.00000000000DL) != 0uwb |
a2f50aa2 JJ |
95 | || testu575 (42.99999999999999999999999999999999DL) != 42uwb |
96 | || testu575 (42.e+21DL) != 42000000000000000000000uwb | |
97 | || testu575 (94272319854.45429e+27DL) != 94272319854454290000000000000000000000uwb | |
98 | || testu575 (1236652007365522670302512605098235.0e+140DL) != 123665200736552267030251260509823500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000uwb) | |
99 | __builtin_abort (); | |
100 | if (testu575 (-1.DL) != 0uwb | |
101 | || testu575 (-42.5e+15DL) != 0uwb | |
102 | || testu575 (-9999999999999999999999999999999999e+6111DL) != 0uwb | |
103 | || testu575 (1236652007365522670302512605098236.0e+140DL) != 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb | |
104 | || testu575 (9999999999999999999999999999999999e+6111DL) != 123665200736552267030251260509823595017565674550605919957031528046448612553265933585158200530621522494798835713008069669675682517153375604983773077550946583958303386074349567uwb) | |
105 | __builtin_abort (); | |
106 | #endif | |
107 | } |