summaryrefslogtreecommitdiff
path: root/libmudflap/testsuite/libmudflap.c/fail30-frag.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmudflap/testsuite/libmudflap.c/fail30-frag.c')
-rw-r--r--libmudflap/testsuite/libmudflap.c/fail30-frag.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libmudflap/testsuite/libmudflap.c/fail30-frag.c b/libmudflap/testsuite/libmudflap.c/fail30-frag.c
new file mode 100644
index 000000000..8bfea61cb
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c/fail30-frag.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int foo (int u)
+{
+ return u*u;
+}
+
+int main ()
+{
+int *k = malloc(5);
+int j = foo (k[8]); /* this call argument should be instrumented */
+return j;
+}
+/* { dg-output "mudflap violation 1.*" } */
+/* { dg-output "Nearby object.*" } */
+/* { dg-output "mudflap object.*malloc region.*alloc" } */
+/* { dg-do run { xfail *-*-* } } */