summaryrefslogtreecommitdiff
path: root/libmudflap/testsuite/libmudflap.c/fail34-frag.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmudflap/testsuite/libmudflap.c/fail34-frag.c')
-rw-r--r--libmudflap/testsuite/libmudflap.c/fail34-frag.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libmudflap/testsuite/libmudflap.c/fail34-frag.c b/libmudflap/testsuite/libmudflap.c/fail34-frag.c
new file mode 100644
index 000000000..f6572b019
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c/fail34-frag.c
@@ -0,0 +1,22 @@
+#include <stdlib.h>
+
+struct s
+{
+ int a1[4];
+};
+
+struct s a, b;
+int idx = 7; /* should pass to the next object */
+
+int
+main ()
+{
+ int i, j=0;
+ int a_before_b = (& a < & b);
+ j = (a_before_b ? a.a1[idx] : b.a1[idx]);
+ return j;
+}
+/* { dg-output "mudflap violation 1.*" } */
+/* { dg-output "Nearby object.*" } */
+/* { dg-output "mudflap object.*\[ab\]" } */
+/* { dg-do run { xfail *-*-* } } */