| /* PR c/102989 */ |
| /* { dg-do run { target bitint } } */ |
| /* { dg-options "-std=c23 -pedantic-errors" } */ |
| /* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */ |
| /* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */ |
| |
| #if __BITINT_MAXWIDTH__ >= 323 |
| __attribute__((noipa)) _BitInt(323) |
| foo (_BitInt(318) x, _BitInt(323) y) |
| { |
| return x + y; |
| } |
| |
| __attribute__((noipa)) _BitInt(323) |
| bar (_BitInt(117) x, _BitInt(323) y) |
| { |
| return x + y; |
| } |
| #endif |
| |
| int |
| main () |
| { |
| #if __BITINT_MAXWIDTH__ >= 323 |
| if (foo (-27733041854193447641086572824547940096595738628642819753407953445763239714154199953745005898992wb, |
| 4767458710334760668834645815738583537909191474644120198636728988961922824468904018596948147773722wb) |
| != 4739725668480567221193559242914035597812595736015477378883321035516159584754749818643203141874730wb |
| || (foo (22167179033351019542845489620035412963406090796537167425591583962059414367893933412196721063711wb, |
| 5235750662037407195417484618645691209305675673195256409842928988743249911043551311451335001624960wb) |
| != 5257917841070758214960330108265726622269081763991793577268520572705309325411445244863531722688671wb)) |
| __builtin_abort (); |
| if (bar (-12653567664155974398995022748067044wb, |
| 7190977642064159111525225823679712940862545424809645152399787447341776579576645887978584020321431wb) |
| != 7190977642064159111525225823679712940862545424809645152399787434688208915420671488983561272254387wb |
| || (bar (30518211833575333685611432934770228wb, |
| 2152360419596992042662178082767272400451689654640037233902067223067458441134717528282349099466966wb) |
| != 2152360419596992042662178082767272400451689654640037233902067253585670274710051213893782034237194wb)) |
| __builtin_abort (); |
| #endif |
| } |