✓
Passing This code compiles and runs correctly.
Code
// Test 430_008: Pipeline Profiling - Time Frontend Pass
//
// Override frontend pass to add timing using $std/time.
~import "$std/compiler"
~import "$std/time"
~import "$std/io"
// ============================================================================
// TIMED FRONTEND (using stdlib!)
// ============================================================================
~std.compiler:frontend = std.time:now()
| t start |> std.compiler:frontend.default(ctx)
| ctx c |> std.time:elapsed(start: start.ns, label: "frontend") |> ctx c
// The actual program
~std.io:print.ln("Compiled with timed frontend!")
Expected Output
Compiled with timed frontend!
Test Configuration
MUST_RUN
Post-validation Script:
#!/bin/bash
# Post-validation: Verify frontend timing output
set -e
if [ ! -f "backend.err" ]; then
echo "❌ FAIL: No backend.err file found"
exit 1
fi
# Check for frontend timing
if ! grep -q "⏱️ frontend:" backend.err; then
echo "❌ FAIL: No frontend timing found"
exit 1
fi
# Extract and display the timing
TIMING=$(grep "⏱️ frontend:" backend.err)
echo "✅ Frontend timing found: $TIMING"
exit 0