Files
ngspice/paranoia_parallel/examples/control_structs/repeat_s.sp
T
Brian Taylor d881158a41 Paranoia_Parallel: a test suite for more than 100 test circuits,
running in parallel on a multi-core machine (12 min execution time
on a i9 9900, ngspice compiled with gcc, debug mode enabled.
Linux with Valgrind and Parallel are required.
2026-06-29 17:35:00 +02:00

47 lines
893 B
SourcePawn

Test sequences for ngspice control structures
*vectors are used (except foreach)
*start in interactive mode
.control
* test for label, goto
echo
let index = 0
label starthere2
let loop = 0
echo We are at start with index "$&index" and loop "$&loop"
if index < 6
label inhere
let index = index + 1
if loop < 3
let loop = loop + 1
if index > 1
echo jump2
goto starthere2
end
end
echo jump
goto inhere
end
echo We are at end with index "$&index" and loop "$&loop"
* test goto in while loop
echo
let loop = 0
if 1 ; outer loop to allow nested forward label 'endlabel'
while loop < 10
if loop > 5
echo jump
goto endlabel
end
let loop = loop + 1
end
echo before ; never reached
label endlabel
echo after "$&loop"
end
quit
.endc