aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_function_pointers.sh18
1 files changed, 15 insertions, 3 deletions
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