yarpgen

又一个随机程序生成器。「Yet Another Random Program Generator」

Github星跟蹤圖

TravisCI build status (Linux and Mac)
Appveyor build status (Windows and Ubuntu)
License

Yet Another Random Program Generator

yarpgen is a random C/C++ program generator, which produces correct runnable C/C++ programs. The generator is specifically designed to trigger compiler optimization bugs and is intended for compiler testing.

A generated random program is guaranteed to be statically and dynamically correct C/C++ program. This implies no undefined behavior, but allows for implementation defined behavior.

Each generated program consists of several files and after being compiled and run produces a decimal number, which is hash of all program global variable values. This number is supposed to be the same for all compilers and optimization levels. If the output differs for different compilers and/or optimization levels, you should have encountered a compiler bug.

Several techniques are used to increase the probability of triggering compiler bugs:

  • all variable types, alignments and values / value ranges are known at the time of generation, which allows the accurate detection of undefined behavior and provides maximum variability of produced code.
  • the generation is random, but it is guided by a number of policies, which increase the likelihood of applying optimizations to the generated code.
  • in some cases a high level model of computations with known properties is generated first and then augmented with other random computations. This ensures that the code is "meaningful" and is more similar to code written by a human being.

Compiler bugs found by YARP Generator

yarpgen managed to find more than 140 bugs in gcc and clang and a comparable number of bugs in proprietary compilers. For the list of the bugs in gcc and clang see bugs.rst.

If you have used yarpgen to find bugs in open source compilers, please update bugs.rst. We are also excited to hear about your experience using it with proprietary compilers and other tools you might want to validate.

Building and running

Building yarpgen is trivial. All you have to do is invoke "make".

To run yarpgen we recommend using run_gen.py script, which will run the generator for you on a number of available compilers with a set of pre-defined options. Feel free to hack test_set.txt to add or remove compiler options.

The script will run several compilers with several compiler options and run executables to compare the output results. If the results mismatch, the test program will be saved in "results" folder for your analysis.

Also you may want to test compilers for future hardware, which is not available to you at the moment. The standard way to do that is to download the Intel® Software Development Emulator. run_gen.py assumes that it is available in your PATH.

Mailing list

To contact authors, ask questions, or leave your feedback please use yarp-gen mailing list.

People

  • Dmitry Babokin
  • Anton Mitrokhin
  • Vsevolod Livinskiy

主要指標

概覽
名稱與所有者hrules6872/Charter
主編程語言Java
編程語言Python (語言數: 1)
平台
許可證
所有者活动
創建於2015-10-13 21:20:38
推送於2017-04-10 08:20:17
最后一次提交2017-04-10 10:20:17
發布數8
最新版本名稱ver151 (發布於 )
第一版名稱ver110 (發布於 )
用户参与
星數229
關注者數6
派生數60
提交數29
已啟用問題?
問題數7
打開的問題數2
拉請求數0
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?