aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.7/libmudflap/testsuite/libmudflap.c/fail36-frag.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.7/libmudflap/testsuite/libmudflap.c/fail36-frag.c')
-rw-r--r--gcc-4.7/libmudflap/testsuite/libmudflap.c/fail36-frag.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.7/libmudflap/testsuite/libmudflap.c/fail36-frag.c b/gcc-4.7/libmudflap/testsuite/libmudflap.c/fail36-frag.c
new file mode 100644
index 000000000..af6851c1d
--- /dev/null
+++ b/gcc-4.7/libmudflap/testsuite/libmudflap.c/fail36-frag.c
@@ -0,0 +1,23 @@
+#include <stdlib.h>
+
+struct k
+{
+ int p;
+ struct {
+ int m : 31;
+ } q;
+};
+
+int
+main ()
+{
+ volatile struct k *l = malloc (sizeof (int)); /* make it only big enough for k.p */
+ /* Confirm that we instrument this nested construct
+ BIT_FIELD_REF(COMPONENT_REF(INDIRECT_REF)). */
+ l->q.m = 5;
+ return 0;
+}
+/* { dg-output "mudflap violation 1.*" } */
+/* { dg-output "Nearby object.*" } */
+/* { dg-output "mudflap object.*" } */
+/* { dg-do run { xfail *-*-* } } */