aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-28 14:59:04 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-28 14:59:04 -0700
commit0b222be053ad17a677938c3156c47842b7389a6d (patch)
treecbab9605bf8116c26b2b39baf9506a5bc429a894 /tests/runner.py
parent0be34770addebcc0e7b21bf4fca7694cc5e00592 (diff)
fix string detection regexp and add test
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 1856016f..8e2e7b28 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2866,6 +2866,35 @@ def process(filename):
'''
self.do_run(src, 'fault on write to 0')
+ def test_trickystring(self):
+ src = r'''
+ #include <stdio.h>
+
+ typedef struct
+ {
+ int (*f)(void *);
+ void *d;
+ char s[16];
+ } LMEXFunctionStruct;
+
+ int f(void *user)
+ {
+ return 0;
+ }
+
+ static LMEXFunctionStruct const a[] =
+ {
+ {f, (void *)(int)'a', "aa"}
+ };
+
+ int main()
+ {
+ printf("ok\n");
+ return a[0].f(a[0].d);
+ }
+ '''
+ self.do_run(src, 'ok\n')
+
def test_statics(self):
# static initializers save i16 but load i8 for some reason
if Settings.SAFE_HEAP: