# Build and run the CP01 checks with Visual Studio's clang++ (C++20, warnings on).# .\run.ps1 every step# .\run.ps1 3 step 3 only# .\run.ps1 -Bench time your one-pass code against the brute force (after step 9)# .\run.ps1 -Gate the mastery gate's checks (gate\gate.h)param([int]$Step=0,[switch]$Bench,[switch]$Gate)$clang="C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\Llvm\x64\bin\clang++.exe"if(-not(Test-Path$clang)){$clang="clang++"}$flags=@("-std=c++20","-O2","-Wall","-Wextra","-Wshadow","-Wno-unused-parameter")Push-Location$PSScriptRoottry{if($Gate){&$clang@flags-ogate\gate_check.exegate\gate_check.cppif($LASTEXITCODE-ne0){Write-Host"Build failed: read the FIRST error above.";exit1}.\gate\gate_check.exeexit$LASTEXITCODE}if($Bench){&$clang@flags-obench.exebench.cppif($LASTEXITCODE-ne0){Write-Host"Build failed: read the FIRST error above.";exit1}.\bench.exeexit$LASTEXITCODE}&$clang@flags-ocheck.execheck.cppif($LASTEXITCODE-ne0){Write-Host"Build failed: read the FIRST error above.";exit1}if($Step-gt0){.\check.exe$Step}else{.\check.exe}exit$LASTEXITCODE}finally{Pop-Location}