#!/bin/sh
# DF-1046 harness build — compiles both the buggy (uint8_t i, mirrors current
# kernel) and fixed (unsigned int i, mirrors the patched kernel) variants of
# the loop-semantics harness.
#
# This is a USERSPACE harness that replicates the exact loop in
# sys/bus/u4b/uvc/uvc_ctrls.c:917-978 (uvc_ctrl_init_dev). The kernel path is
# only reachable at USB-device-attach time and the test guest has no USB
# hardware, so we prove the primitive here.
set -e
cd "$(dirname "$0")"
cc -DBUGGY -O2 -o harness_buggy harness.c
cc        -O2 -o harness_fixed harness.c
echo "BUILD_OK: harness_buggy, harness_fixed"
