This is an archive of the discontinued LLVM Phabricator instance.

[TestMiBreak] Print a formatted string via printf in the test case.
ClosedPublic

Authored by sivachandra on Apr 14 2015, 4:39 PM.

Details

Summary

If the string is not formatted, these can happen when compiled with GCC:

  1. If it is a null string "", then GCC completely removes the call to

printf even with -O0.

  1. If the string is a single character string, say "\n" for example,

then GCC replaces the call to printf with a call to putchar.

  1. If the string length is greater than 1, but is not formatted, then

GCC replaces the call to printf with a call to puts.

All the above will fail the test as we want a breakpoint on "printf" to
hit.

Diff Detail

Event Timeline

sivachandra retitled this revision from to [TestMiBreak] Print a formatted string via printf in the test case..
sivachandra updated this object.
sivachandra edited the test plan for this revision. (Show Details)
sivachandra added reviewers: ki.stfu, chying.
sivachandra added a subscriber: Unknown Object (MLST).
ki.stfu accepted this revision.Apr 14 2015, 9:39 PM
ki.stfu edited edge metadata.
This revision is now accepted and ready to land.Apr 14 2015, 9:39 PM
sivachandra closed this revision.Apr 15 2015, 11:35 AM