diff options
-rw-r--r-- | tests/core/test_alloca.in | 11 | ||||
-rw-r--r-- | tests/core/test_alloca.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 14 |
3 files changed, 15 insertions, 11 deletions
diff --git a/tests/core/test_alloca.in b/tests/core/test_alloca.in new file mode 100644 index 00000000..7b53e56c --- /dev/null +++ b/tests/core/test_alloca.in @@ -0,0 +1,11 @@ + + #include <stdio.h> + #include <stdlib.h> + + int main() { + char *pc; + pc = (char *)alloca(5); + printf("z:%d*%d*\n", pc > 0, (int)pc); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_alloca.out b/tests/core/test_alloca.out new file mode 100644 index 00000000..37de3d6b --- /dev/null +++ b/tests/core/test_alloca.out @@ -0,0 +1 @@ +z:1*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index b72ae793..0092a27d 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1552,18 +1552,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) def test_alloca(self): - src = ''' - #include <stdio.h> - #include <stdlib.h> + test_path = path_from_root('tests', 'core', 'test_alloca') + src, output = (test_path + s for s in ('.in', '.out')) - int main() { - char *pc; - pc = (char *)alloca(5); - printf("z:%d*%d*\\n", pc > 0, (int)pc); - return 0; - } - ''' - self.do_run(src, 'z:1*', force_c=True) + self.do_run_from_file(src, output, force_c=True) def test_rename(self): src = open(path_from_root('tests', 'stdio', 'test_rename.c'), 'r').read() |