with rigorous integration test Reviewed By: bixia Differential Revision: https://reviews.llvm.org/D108721