diff options
-rw-r--r-- | src/library.js | 2 | ||||
-rw-r--r-- | tests/dlmalloc.c | 25 | ||||
-rw-r--r-- | tests/runner.py | 1 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 3b4c0962..529a5d3f 100644 --- a/src/library.js +++ b/src/library.js @@ -4047,7 +4047,7 @@ LibraryManager.library = { }, llvm_expect_i32: function(x, y) { - assert(x == y, 'Expect failed!'); + return x == y; }, // ========================================================================== diff --git a/tests/dlmalloc.c b/tests/dlmalloc.c index 93bacc63..b4988dce 100644 --- a/tests/dlmalloc.c +++ b/tests/dlmalloc.c @@ -5737,3 +5737,28 @@ int main(int ac, char **av) printf("*%d,%d*\n", c1, c2); } +/* Some debugging tools: Make JS and native code work exactly the same */ +/* +time_t time ( time_t * timer ) +{ + if (timer) *timer = 1; + return 1; +} + +long sysconf(int name) +{ + printf("sysconf: %d (30 is page size)\n", name); + return 4096; +} + +void *sbrk(intptr_t increment) +{ + static char spaace[1024*1024*1]; + static intptr_t where = 0; + printf("sbrk! spaace=%d (%d,%d)\n", (int)&spaace[0], where, increment); // copy the value printed at runtime here in native code into your js + void *ret = &spaace[where]; + where += increment; + return ret; +} +*/ + diff --git a/tests/runner.py b/tests/runner.py index e24ea5b1..4dca5f63 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2902,7 +2902,6 @@ if 'benchmark' not in str(sys.argv): self.do_test(src, j, [str(i)], lambda x: x.replace('\n', '*'), no_build=i>1) def test_dlmalloc(self): - #global DISABLE_EXCEPTIONS; DISABLE_EXCEPTIONS = 1 global CORRECT_SIGNS; CORRECT_SIGNS = 2 global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]] |