diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-28 14:59:04 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-28 14:59:04 -0700 |
commit | 0b222be053ad17a677938c3156c47842b7389a6d (patch) | |
tree | cbab9605bf8116c26b2b39baf9506a5bc429a894 /tests/runner.py | |
parent | 0be34770addebcc0e7b21bf4fca7694cc5e00592 (diff) |
fix string detection regexp and add test
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 29 |
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: |