aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-28 14:38:29 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-28 14:38:29 -0700
commit0be34770addebcc0e7b21bf4fca7694cc5e00592 (patch)
tree6141394b2db296a9a04192c4142451072f36dcca /tests/runner.py
parenta8db0c66afa1a348c2d26b290faaf7b3420d7dbc (diff)
throw on writes to absolute memory addresses; fixes #451
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index d6731ed5..1856016f 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2856,6 +2856,16 @@ def process(filename):
extra_emscripten_args=['-H', 'libc/time.h'])
#extra_emscripten_args=['-H', 'libc/fcntl.h,libc/sys/unistd.h,poll.h,libc/math.h,libc/langinfo.h,libc/time.h'])
+ def test_intentional_fault(self):
+ # Some programs intentionally segfault themselves, we should compile that into a throw
+ src = r'''
+ int main () {
+ *(volatile char *)0 = 0;
+ return 0;
+ }
+ '''
+ self.do_run(src, 'fault on write to 0')
+
def test_statics(self):
# static initializers save i16 but load i8 for some reason
if Settings.SAFE_HEAP: