From 1b208f7f0a3b7d6b72c2a431d9fcd6e18fe76f5d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 28 Sep 2025 15:24:28 +0900 Subject: feat: support using function as a value --- tests/test_function_pointers.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_function_pointers.sh b/tests/test_function_pointers.sh index c97a087..cddc623 100644 --- a/tests/test_function_pointers.sh +++ b/tests/test_function_pointers.sh @@ -1,12 +1,24 @@ cat <<'EOF' > expected +a +h +g EOF test_diff <<'EOF' -int* f(int a); -int (*f)(int a); +int* f1(int a); +int (*f2)(int a); extern int atexit (void (*) (void)); extern int atexit (void (*fn) (void)); -int main() {} +int printf(const char*, ...); + +void g() { printf("g\n"); } +void h() { printf("h\n"); } + +int main() { + atexit(g); + atexit(h); + printf("a\n"); +} EOF -- cgit v1.2.3-70-g09d2