📄 tests/examples/simple_if.c
1/*2 * simple_if.c — Minimal example for the C Testing Coverage Tool smoke test.3 *4 * This file contains 2 branch constructs = 4 branches total.5 * A complete test suite should cover all 4 branches (100%).6 *7 * Build and run via:8 * bash smoke_test.sh9 */10#include <stdio.h>11extern int __VERIFIER_nondet_int(void);1213int main(void) {14 int x = __VERIFIER_nondet_int();1516 /* Branch 1: true = x > 0, false = x <= 0 */17 if (x > 0) {●FULL18 printf("positive\n");19 } else {20 printf("non-positive\n");21 }2223 /* Branch 2: true = even, false = odd */24 if (x % 2 == 0) {●FULL25 printf("even\n");26 } else {27 printf("odd\n");28 }2930 return 0;31}