[PATCH] D34055: Be more strict when checking the -flto option value

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 9 18:03:20 PDT 2017


tejohnson added a comment.

In https://reviews.llvm.org/D34055#777005, @yamaguchi wrote:

> I think we don't need additional testcase, because this is non-functional change. Driver.cpp will emit error if value was not "thin" nor "full". This testcase is at clang/test/CodeGen/thinlto-backend-option.ll.


That test case is checking that -flto=thin is accepted by the driver. I don't see it checking for an unknown -flto= value. But in any case, you can go through the code you are fixing here without hitting the driver check by invoking clang -cc1 (%clang_cc1 in the test case). I just confirmed that -flto=thinfoo is flagged as an error by clang (when it goes through the driver), but is silently accepted if I pass directly to clang -cc1. So this is definitely a bug fix and it would be good to check for invalid -flto values and given an error,  then have a test that uses %clang_cc1 and confirms that an unknown -flto= value gets that error.


https://reviews.llvm.org/D34055





More information about the cfe-commits mailing list