icmp_cset_ne_int.c (376B)
1 /* icmp != on 32-bit ints materialized to a boolean (cmp + cset ne). volatile 2 * operands defeat constant folding. Exercises `cset w, ne`. 3 * Exit code: (5!=6)*40 + (5!=5)*100 + 2 = 40 + 0 + 2 = 42. */ 4 int test_main(void) { 5 volatile int a = 5, b = 5, c = 6; 6 int ne_true = (a != c); /* 1 */ 7 int ne_false = (a != b); /* 0 */ 8 return ne_true * 40 + ne_false * 100 + 2; 9 }