kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

fparith_double_add.c (331B)


      1 /* Double FADD round-trip. volatile int inputs are converted to double so a real
      2  * SCVTF + FADD (double) is emitted (no constant folding). 40.0 + 2.0 = 42.0;
      3  * (int)42.0 == 42. */
      4 int test_main(void) {
      5   volatile int ia = 40, ib = 2;
      6   double a = (double)ia, b = (double)ib;
      7   double r = a + b;
      8   return (int)r == 42 ? 42 : 0;
      9 }