{"push_id":543675251,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"cf3831b44467a1f54a4790e863c8fb1993222f91","before":"a7abdb649ecd9ab17277f586cf86a2fcde7bd494","commits":[{"sha":"cf3831b44467a1f54a4790e863c8fb1993222f91","author":{"email":"420c9fb3407b8e11ac322a0e7703f7b1f526df04@gmail.com","name":"Chandler Carruth"},"message":"Add a new utility script that helps update very simple regression tests.\n\nThis script is currently specific to x86 and limited to use with very\nsmall regression or feature tests using 'llc' and 'FileCheck' in\na reasonably canonical way. It is in no way general purpose or robust at\nthis point. However, it works quite well for simple examples. Here is\nthe intended workflow:\n\n- Make a change that requires updating N test files and M functions'\n  assertions within those files.\n- Stash the change.\n- Update those N test files' RUN-lines to look \"canonical\"[1].\n- Refresh the FileCheck lines for either the entire file or select\n  functions by running this script.\n  - The script will parse the RUN lines and run the 'llc' binary you\n    give it according to each line, collecting the asm.\n  - It will then annotate each function with the appropriate FileCheck\n    comments to check every instruction from the start of the first\n    basic block to the last return.\n  - There will be numerous cases where the script either fails to remove\n    the old lines, or inserts checks which need to be manually editted,\n    but the manual edits tend to be deletions or replacements of\n    registers with FileCheck variables which are fast manual edits.\n  - A common pattern is to have the script insert complete checking of\n    every instruction, and then edit it down to only check the relevant\n    ones.\n  - Be careful to do all of these cleanups though! The script is\n    designed to make transferring and formatting the asm output of llc\n    into a test case fast, it is *not* designed to be authoratitive\n    about what constitutes a good test!\n- Commit the nice fresh baseline of checks.\n- Unstash your change and rebuild llc.\n- Re-run script to regenerate the FileCheck annotations\n  - Remember to re-cleanup these annotations!!!\n- Check the diff to make sure this is sane, checking the things you\n  expected it to, and check that the newly updated tests actually pass.\n- Profit!\n\nAlso, I'm *terrible* at writing Python, and frankly I didn't spend a lot\nof time making this script beautiful or well engineered. But it's useful\nto me and may be useful to others so I thought I'd send it out.\n\nhttp://reviews.llvm.org/D5546","distinct":true,"url":"https://api.github.com/repos/chapuni/llvm-project/commits/cf3831b44467a1f54a4790e863c8fb1993222f91"}]}