summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c')
-rw-r--r--gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c b/gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c
new file mode 100644
index 000000000..2ad012116
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c
@@ -0,0 +1,26 @@
+/* This file provides auxilliary functions for c_ptr_tests_8. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+extern void abort (void);
+
+void *create (void)
+{
+ int *a;
+ a = malloc (sizeof (a));
+ *a = 444;
+ return a;
+
+}
+
+void show (int *a)
+{
+ if (*a == 444)
+ printf ("SUCCESS (%d)\n", *a);
+ else
+ {
+ printf ("FAILED: Expected 444, received %d\n", *a);
+ abort ();
+ }
+}