summaryrefslogtreecommitdiff
path: root/libmudflap/testsuite/libmudflap.c/pass32-frag.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmudflap/testsuite/libmudflap.c/pass32-frag.c')
-rw-r--r--libmudflap/testsuite/libmudflap.c/pass32-frag.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libmudflap/testsuite/libmudflap.c/pass32-frag.c b/libmudflap/testsuite/libmudflap.c/pass32-frag.c
new file mode 100644
index 000000000..d7f223279
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c/pass32-frag.c
@@ -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;
+}