]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - libmudflap/testsuite/libmudflap.c/hook-allocstuff.c
Imported gcc-4.4.3
[msp430-gcc.git] / libmudflap / testsuite / libmudflap.c / hook-allocstuff.c
diff --git a/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c b/libmudflap/testsuite/libmudflap.c/hook-allocstuff.c
new file mode 100644 (file)
index 0000000..dc25375
--- /dev/null
@@ -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" } */