aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-01 18:31:01 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-02-01 18:31:01 -0800
commit5aacaae25eb261c6029e8b3df111328fa0bf8166 (patch)
tree7edf6c7701536ebb51d098fc2e47d371677f189e
parent33ba871c65d997ef89ad3ac640f5797efc67f4a9 (diff)
parent9c4d8b6d50f1891665299aaba86e917f2306590f (diff)
Merge pull request #819 from waywardmonkeys/fix-test-longjmp
Variables live across a setjmp/lj must be volatile.
-rwxr-xr-xtests/runner.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/runner.py b/tests/runner.py
index d0e641e6..4c8b6379 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2196,7 +2196,7 @@ Succeeded!
}
int main() {
- int x = 0;
+ volatile int x = 0;
if ( ! setjmp(buf) ) {
x++;
first(); // when executed, setjmp returns 0
@@ -2207,11 +2207,7 @@ Succeeded!
return 0;
}
'''
- # gcc -O0 and -O2 differ in what they do with the saved state of local vars - and we match that
- if self.emcc_args is None or ('-O1' not in self.emcc_args and '-O2' not in self.emcc_args):
- self.do_run(src, 'second\nmain: 1\n')
- else:
- self.do_run(src, 'second\nmain: 0\n')
+ self.do_run(src, 'second\nmain: 1\n')
def test_longjmp2(self):
if Settings.ASM_JS: return self.skip('asm does not support longjmp')