From 85483f321d8df6cce08ef88d86f50c9a60b307ef Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 18 Apr 2019 03:39:40 +0200 Subject: [PATCH] Add 103_implicit_memmove testcase which checks that a declaration after TCC implicitely declares an internally used function (memmove here) doesn't create any problem. --- tests/tests2/103_implicit_memmove.c | 20 ++++++++++++++++++++ tests/tests2/103_implicit_memmove.expect | 0 2 files changed, 20 insertions(+) create mode 100644 tests/tests2/103_implicit_memmove.c create mode 100644 tests/tests2/103_implicit_memmove.expect diff --git a/tests/tests2/103_implicit_memmove.c b/tests/tests2/103_implicit_memmove.c new file mode 100644 index 00000000..a5e53034 --- /dev/null +++ b/tests/tests2/103_implicit_memmove.c @@ -0,0 +1,20 @@ +/* Test that the memmove TCC is emitting for the struct copy + and hence implicitely declares can be declared properly also + later. */ +struct S { int a,b,c,d, e[1024];}; +int foo (struct S *a, struct S *b) +{ + *a = *b; + return 0; +} + +void *memmove(void*,void*,long); +void foo2 (struct S *a, struct S *b) +{ + memmove(a, b, sizeof *a); +} + +int main() +{ + return 0; +} diff --git a/tests/tests2/103_implicit_memmove.expect b/tests/tests2/103_implicit_memmove.expect new file mode 100644 index 00000000..e69de29b