view test/compile/bytecode_dountil.m @ 32151:72dcb1cef2c9

maint: Strip trailing whitespace from source files. Modified files: NEWS.8.md, file-editor-tab.cc, call-stack.cc, compile.cc, perms.cc, stack-frame.cc, ov-base.cc, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.cc, ov-oncleanup.h, ov-range.cc, ov-range.h, ov-ref.cc, ov-ref.h, ov-scalar.h, ov-struct.cc, ov-vm.h, pt-bytecode-vm-internal.h, pt-bytecode-vm.cc, pt-bytecode-vm.h, pt-bytecode-walk.cc, pt-eval.cc, isuniform.m, inputParser.m, xlim.m, ylim.m, zlim.m, movfun.m, std.m, var.m, isstrprop.m, bench.m, bench.py, bytecode.tst, bytecode_anon_handles.m, bytecode_cell.m, bytecode_dountil.m, bytecode_end.m, bytecode_errors.m, bytecode_eval_1.m, bytecode_for.m, bytecode_global_1.m, bytecode_if.m, bytecode_leaks.m, bytecode_matrix.m, bytecode_multi_assign.m, bytecode_persistant.m, bytecode_range.m, bytecode_trycatch.m, bytecode_unwind.m, bytecode_while.m, bytecode_disp.m, bytecode_disp.tst, parser.tst.
author John W. Eaton <jwe@octave.org>
date Mon, 19 Jun 2023 23:21:41 -0400
parents 6e6e99e8a4de
children
line wrap: on
line source

function bytecode_dountil ()
  i = 5;
  do
    __printf_assert__ ("%d ", i);
    i--;
  until i

  i = 0;
  do
    i++;
  until i >= 3
  __printf_assert__ ("%d ", i);

  i = 0;
  ctr = 0;
  do
    ctr++;
  until i++ >= 4
  __printf_assert__ ("%d ", i);
  __printf_assert__ ("%d ", ctr);

  i = 0;
  ctr = 0;
  do
    ctr++;
  until ++i >= 4
  __printf_assert__ ("%d ", i);
  __printf_assert__ ("%d ", ctr);

  i = 0;
  ctr = 0;
  do
    i++;
    if i == 2
      continue
    end
    ctr++;
  until i >= 4
  __printf_assert__ ("%d ", ctr);
  __printf_assert__ ("%d ", i);

  i = 0;
  ctr = 0;
  do
    i++;
    if i == 2
      break
    end
    ctr++;
  until i >= 4
  __printf_assert__ ("%d ", ctr);
  __printf_assert__ ("%d ", i);

  i = 0;
  ctr = 0;
  do
    i++;
    if i == 2
      continue
    elseif i == 3
      break
    end
    ctr++;
  until i >= 4
  __printf_assert__ ("%d ", ctr);
  __printf_assert__ ("%d ", i);

  i = 0;
  do
    i++;
    if i == 1
      continue
    else
      break
    end
  until i > 100
  __printf_assert__ ("%d ", i);

  ctr = 0;
  j = 0;
  do
    i = 0;
    do
      k = 0;
      do
        k++;
        ctr++;
      until k >= 2
      i++;
    until i > 2
    j++;
  until j >= 2
  __printf_assert__ ("%d ", ctr);

  i = 0;
  do
    i++;
    if i == 4
      break;
    end
    continue;
  until i == 3
  __printf_assert__ ("%d ", i);

  i = 0;
  do
    break
  until i++ > 2
  __printf_assert__ ("%d ", i);

  i = 0;
  do
  until i++ == 2
  __printf_assert__ ("%d ", i);
end