X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libmudflap%2Ftestsuite%2Flibmudflap.c%2Ffail21-frag.c;fp=libmudflap%2Ftestsuite%2Flibmudflap.c%2Ffail21-frag.c;h=4ab4a09f3b00e9675a6c745b4980fe53b930e10a;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libmudflap/testsuite/libmudflap.c/fail21-frag.c b/libmudflap/testsuite/libmudflap.c/fail21-frag.c new file mode 100644 index 00000000..4ab4a09f --- /dev/null +++ b/libmudflap/testsuite/libmudflap.c/fail21-frag.c @@ -0,0 +1,18 @@ +#include +#include +#include +int main () +{ + int *bar = (int *) malloc (sizeof (int)); +/* Make an access here to get &foo into the lookup cache. */ +*bar = 5; +__mf_watch (bar, sizeof(int)); +/* This access should trigger the watch violation. */ +*bar = 10; +/* NOTREACHED */ +return 0; +} +/* { dg-output "mudflap violation 1.*watch.*" } */ +/* { dg-output "Nearby object 1.*" } */ +/* { dg-output "mudflap object.*malloc region.*" } */ +/* { dg-do run { xfail *-*-* } } */