def test_memorygrowth_2(self):
    if self.has_changed_setting('ALLOW_MEMORY_GROWTH'):
        self.skipTest('test needs to modify memory growth')
    src = open(path_from_root('tests', 'core', 'test_memorygrowth_2.c')).read()
    self.do_run(src, 'OOM', assert_returncode=None)
    fail = open('src.cpp.o.js').read()
    self.emcc_args += ['-Wno-almost-asm', '-s', 'ALLOW_MEMORY_GROWTH']
    self.do_run(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
    win = open('src.cpp.o.js').read()
    if (('-O2' in self.emcc_args) and (not self.is_wasm())):
        assert (len(fail) < len(win)), ('failing code - without memory growth on - is more optimized, and smaller' + str([len(fail), len(win)]))
def test_memorygrowth_2(self):
    if self.has_changed_setting('ALLOW_MEMORY_GROWTH'):
        self.skipTest('test needs to modify memory growth')
    src = open(path_from_root('tests', 'core', 'test_memorygrowth_2.c')).read()
    self.do_run(src, 'OOM', assert_returncode=None)
    fail = open('src.cpp.o.js').read()
    self.emcc_args += ['-Wno-almost-asm', '-s', 'ALLOW_MEMORY_GROWTH']
    self.do_run(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
    win = open('src.cpp.o.js').read()
    if (('-O2' in self.emcc_args) and (not self.is_wasm())):
        assert (len(fail) < len(win)), ('failing code - without memory growth on - is more optimized, and smaller' + str([len(fail), len(win)]))