# HG changeset patch # User Julien Bect # Date 1509829983 -3600 # Node ID 939925a782e873e9b068971c2f4f086c8f2288fb # Parent 51e408a7d38febbd5691c094e896286926241f7b jit.tst: Comment out unit tests involving try/catch blocks * test/jit.tst: Comment out unit tests involving try/catch blocks. diff -r 51e408a7d38f -r 939925a782e8 test/jit.tst --- a/test/jit.tst Sun Oct 15 21:08:02 2017 +0200 +++ b/test/jit.tst Sat Nov 04 22:13:03 2017 +0100 @@ -18,6 +18,9 @@ ## Author: Max Brister +## Note: unit tests involving try/catch blocks are currently disabled since +## the JIT in its current form is not compatible with exception handling. + ## Turn on JIT and set defaults before running tests %!testif HAVE_LLVM %! global __old_jit_enable__; @@ -95,6 +98,7 @@ %! endparfor %! assert (i, 100); %! assert (jit_failcnt, 0); + ## Test some switch statements %!testif HAVE_LLVM %! jit_failcnt (0); @@ -240,22 +244,22 @@ %! assert (sum (mat) == total); %! assert (jit_failcnt, 0); -%!testif HAVE_LLVM -%! jit_failcnt (0); -%! nr = 1001; -%! mat = [3 1 5]; -%! try -%! for i = 1:nr -%! if (i > 500) -%! result = mat(100); -%! else -%! result = i; -%! endif -%! endfor -%! catch -%! end_try_catch -%! assert (result == 500); -%! assert (jit_failcnt, 0); +# %!testif HAVE_LLVM +# %! jit_failcnt (0); +# %! nr = 1001; +# %! mat = [3 1 5]; +# %! try +# %! for i = 1:nr +# %! if (i > 500) +# %! result = mat(100); +# %! else +# %! result = i; +# %! endif +# %! endfor +# %! catch +# %! end_try_catch +# %! assert (result == 500); +# %! assert (jit_failcnt, 0); %!function result = gen_test (n) %! result = double (rand (1, n) > .01); @@ -385,14 +389,14 @@ %! end_unwind_protect %!endfunction -%!testif HAVE_LLVM -%! jit_failcnt (0); -%! lasterr (""); -%! try -%! test_divide (); -%! end_try_catch -%! assert (strcmp (lasterr (), "division by zero")); -%! assert (jit_failcnt, 0); +# %!testif HAVE_LLVM +# %! jit_failcnt (0); +# %! lasterr (""); +# %! try +# %! test_divide (); +# %! end_try_catch +# %! assert (strcmp (lasterr (), "division by zero")); +# %! assert (jit_failcnt, 0); %!testif HAVE_LLVM %! jit_failcnt (0); @@ -576,14 +580,14 @@ %! assert (id (1, 2), 1); %! assert (jit_failcnt, 0); -%!testif HAVE_LLVM -%! jit_failcnt (0); -%! lasterr (""); -%! try -%! id (); -%! end_try_catch -%! assert (strncmp (lasterr (), "'x' undefined near", 18)); -%! assert (jit_failcnt, 0); +# %!testif HAVE_LLVM +# %! jit_failcnt (0); +# %! lasterr (""); +# %! try +# %! id (); +# %! end_try_catch +# %! assert (strncmp (lasterr (), "'x' undefined near", 18)); +# %! assert (jit_failcnt, 0); ## Restore JIT settings %!testif HAVE_LLVM