X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libmudflap%2Ftestsuite%2Flibmudflap.c%2Fpass54-frag.c;fp=libmudflap%2Ftestsuite%2Flibmudflap.c%2Fpass54-frag.c;h=59cf2fa6258cda32153ee4674e94af344db4821f;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libmudflap/testsuite/libmudflap.c/pass54-frag.c b/libmudflap/testsuite/libmudflap.c/pass54-frag.c new file mode 100644 index 00000000..59cf2fa6 --- /dev/null +++ b/libmudflap/testsuite/libmudflap.c/pass54-frag.c @@ -0,0 +1,33 @@ +struct k +{ + struct { + int b; + int c; + } a; +}; + +static struct k l; +static struct k m; + +void foo () +{ + /* This should not be instrumented. */ + l.a.b = 5; +} + +void bar () +{ + /* This should not be instrumented. */ + m.a.b = 5; +} + +int main () +{ + /* Force TREE_ADDRESSABLE on "l" only. */ + volatile int *k = & l.a.c; + *k = 8; + __mf_set_options ("-mode-violate"); + foo (); + bar (); + __mf_set_options ("-mode-check"); +}