aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.7/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.7/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c')
-rw-r--r--gcc-4.7/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc-4.7/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c b/gcc-4.7/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c
new file mode 100644
index 000000000..dc2537548
--- /dev/null
+++ b/gcc-4.7/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main ()
+{
+ char *foo = (char *) malloc (10);
+ strcpy (foo, "hello");
+ foo = (char *) realloc (foo, 20);
+ printf ("%s", foo);
+ if (strcmp (foo, "hello"))
+ abort ();
+ free (foo);
+ printf (" world\n");
+ return 0;
+}
+/* { dg-output "hello world" } */