diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-09 14:13:09 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-09 17:26:56 -0700 |
commit | c44aaae800adb84de2ae892e1eae77720118d8cf (patch) | |
tree | 80f159de54d4bdd180d4248845290b8f29eeb193 | |
parent | 8bd0457ad49d025489d6c46c0f266daec562dcb5 (diff) |
restore memory initialization and testing
-rwxr-xr-x | emcc | 2 | ||||
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rwxr-xr-x | tests/runner.py | 7 |
3 files changed, 7 insertions, 4 deletions
@@ -721,7 +721,7 @@ try: bind = False jcache = False save_bc = False - memory_init_file = False # XXX TODO True + memory_init_file = True if use_cxx: default_cxx_std = '-std=c++03' # Enforce a consistent C++ standard when compiling .cpp files, if user does not specify one on the cmdline. diff --git a/src/jsifier.js b/src/jsifier.js index 50030268..2a9c5ba8 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1525,7 +1525,7 @@ function JSify(data, functionsOnly, givenFunctions) { // write out the singleton big memory initialization value print('/* memory initializer */ ' + makePointer(memoryInitialization, null, 'ALLOC_NONE', 'i8', 'TOTAL_STACK', true)); // we assert on TOTAL_STACK == GLOBAL_BASE } else { - print('/* memory initializer */'); // test purposes + print('/* no memory initializer */'); // test purposes } } diff --git a/tests/runner.py b/tests/runner.py index 1965cad9..2ce08ddd 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -266,12 +266,15 @@ process(sys.argv[1]) if output_processor is not None: output_processor(open(filename + '.o.js').read()) - if 0:# XXX TODO self.emcc_args is not None: + if self.emcc_args is not None: if '--memory-init-file' in self.emcc_args: memory_init_file = int(self.emcc_args[self.emcc_args.index('--memory-init-file')+1]) else: memory_init_file = 1 - assert ('/* memory initializer */' in open(filename + '.o.js').read()) == (not memory_init_file) + if memory_init_file: + assert '/* memory initializer */' not in open(filename + '.o.js').read() + else: + assert 'memory initializer */' in open(filename + '.o.js').read() def run_generated_code(self, engine, filename, args=[], check_timeout=True, output_nicerizer=None): stdout = os.path.join(self.get_dir(), 'stdout') # use files, as PIPE can get too full and hang us |