]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - libmudflap/testsuite/libmudflap.c/pass32-frag.c
Imported gcc-4.4.3
[msp430-gcc.git] / libmudflap / testsuite / libmudflap.c / pass32-frag.c
diff --git a/libmudflap/testsuite/libmudflap.c/pass32-frag.c b/libmudflap/testsuite/libmudflap.c/pass32-frag.c
new file mode 100644 (file)
index 0000000..d7f2232
--- /dev/null
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+struct foo { char z[10]; };
+
+char * get_z (struct foo *this)
+{
+  return & this->z[0] /* the `this' pointer is not dereferenced! */;
+}
+
+int main ()
+{
+struct foo k;
+char *n = get_z (& k);
+srand ((int)(__mf_uintptr_t) n); /* use the pointer value */
+return 0;
+}