diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-01 15:46:33 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-01 15:46:33 -0800 |
commit | 16c68271b2527d87a01dc9330c7030bde0f5803e (patch) | |
tree | 81e1132a034ca5a97f2f43f9e612448ec814d40e /tests/runner.py | |
parent | 5f41292ca46c8bff504e83c61f816d798b838820 (diff) |
improve loop hoisting and add test
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py index ef452f69..83042d65 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -829,13 +829,23 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv): int main() { int x = 5; - for (int i = 0; i < 6; i++) + for (int i = 0; i < 6; i++) { x += x*i; + if (x > 1000) { + if (x % 7 == 0) printf("cheez\\n"); + x /= 2; + break; + } + } printf("*%d*\\n", x); return 0; } ''' - self.do_run(src, '*3600*') + + self.do_run(src) + + generated = open('src.cpp.o.js', 'r').read() + assert '__label__ ==' not in generated, 'We should hoist into the loop' def test_stack(self): src = ''' |