diff options
Diffstat (limited to 'tests/cpp/tget_subsystem.nim')
-rw-r--r-- | tests/cpp/tget_subsystem.nim | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/cpp/tget_subsystem.nim b/tests/cpp/tget_subsystem.nim index 461914739..6fb095a3d 100644 --- a/tests/cpp/tget_subsystem.nim +++ b/tests/cpp/tget_subsystem.nim @@ -1,5 +1,5 @@ discard """ - cmd: "nim cpp $file" + targets: "cpp" """ {.emit: """ @@ -21,3 +21,19 @@ proc getSubsystem*[T](): ptr T {. let input: ptr Input = getSubsystem[Input]() + +# bugs #4910, #6892 +proc modify(x: var int) = + x = 123 + +proc foo() = + var ts: array[2, int] + for t in mitems(ts): + discard + + for t in mitems(ts): + modify(t) + + for i, t in mpairs(ts): + modify(t) + |