fpcmp_double_eq.c (340B)
1 /* double == and != as bool results (fcmp d, d + cset). volatile operands 2 * defeat constant folding so fcmp is actually emitted. Exit: 21*2 = 42. */ 3 int test_main(void) { 4 volatile double a = 3.5, b = 3.5, c = 9.0; 5 int eq = (a == b); /* 1 */ 6 int ne = (a != c); /* 1 */ 7 int r = 0; 8 if (eq) r += 20; 9 if (ne) r += 22; 10 return r; 11 }