3 the standard guarantees left-to-right evaluation,
4 if the first operand is unequal 0 (resp. 0), the second isn't evaluated.
19 testLeftRightAndOr(void)
23 a
= 0; c
= inc_a(0) || inc_a(0); ASSERT(a
== 2);
24 a
= 0; c
= inc_a(0) || inc_a(1); ASSERT(a
== 2);
25 a
= 0; c
= inc_a(1) || inc_a(0); ASSERT(a
== 1);
26 a
= 0; c
= inc_a(1) || inc_a(1); ASSERT(a
== 1);
28 a
= 0; c
= inc_a(0) && inc_a(0); ASSERT(a
== 1);
29 a
= 0; c
= inc_a(0) && inc_a(1); ASSERT(a
== 1);
30 a
= 0; c
= inc_a(1) && inc_a(0); ASSERT(a
== 2);
31 a
= 0; c
= inc_a(1) && inc_a(1); ASSERT(a
== 2);