部分求值技术在程序优化及软件自动生成等方面起着极为重要的作用.将部分求值技术应用到编译器测试中.为此,设计了一种C语言的子集peC语言,给出了该语言的部分求值策略的形式化描述,实现了peC语言的部分求值器,设计了基于部分求值技术的编译器测试框架.通过实验,该方法可以检测出大部分之前其他方法发现的GCC,LLVM编译器中的错误,此外还发现了其他方法不能发现的错误,这表明,将部分求值技术应用到编译器测试中是有效的.
Partial evaluation plays an important role in many areas such as program optimization and automatic software generation. This paper applies partial evaluation to validating compilers. The design of peC, which is a subset of C, and the formalized description of partial evaluation strategy for peC are presented. Furthermore, the implementation of a partial evaluator for peC, and a compiler testing framework based on partial evaluation are provided. Experiments show that this new approach can not only detect errors which can be detected by other methods in GCC and LLVM but also found some errors which are not detected by the other methods. In summary, the work by this paper demonstrates applying partial evaluation in testing compilers is effective.