diff options
author | fche <fche@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-02 23:12:49 +0000 |
---|---|---|
committer | fche <fche@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-02 23:12:49 +0000 |
commit | 5df46b5217b39abadd8d1dbacdb13482bbe57d30 (patch) | |
tree | 34af220a8005039a10395e1129f99324b64ce2ae /libmudflap/testsuite/libmudflap.c/fail34-frag.c | |
parent | 5a6aa39e1b2f6146fd133d6b851a920a74804959 (diff) | |
download | gcc-5df46b5217b39abadd8d1dbacdb13482bbe57d30.tar.gz |
2004-10-02 Frank Ch. Eigler <fche@redhat.com>
* tree-mudflap.c (mf_build_check_statement_for): Reorganize to
take check-base and -limit arguments.
(mf_xform_derefs_1): Reorganize slightly to pass proper base/limit
check ranges for ARRAY_REF and COMPONENT_REF.
(execute_mudflap_fnction_ops, ..._decls): Limit unnecessary
instrumentation.
2004-10-02 Frank Ch. Eigler <fche@redhat.com>
* testsuite/libmudflap.c/pass50-frag.c, fail33-frag.c, fail34-frag.c:
New tests for proper base/limit checking for aggregates.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88432 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libmudflap/testsuite/libmudflap.c/fail34-frag.c')
-rw-r--r-- | libmudflap/testsuite/libmudflap.c/fail34-frag.c | 22 |
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 00000000000..f6572b019a4 --- /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 *-*-* } } */ |