periscop / cloog

The CLooG Code Generator in the Polyhedral Model
GNU Lesser General Public License v2.1
40 stars 23 forks source link

Execution test corrections #45

Closed PapyChacal closed 3 years ago

PapyChacal commented 4 years ago

Some execution tests were not functioning, for a total of four reasons :

  1. Some just didn't have a reference (.good.c) file. These are generated in this PR.
  2. Some were meant to test empty scop generation. The test is expected to send a warning when the execution didn't scan any point, so those cases were left unhandled.
  3. Some are about statement body generation. The execution comparison program expect instruction in the S_(i,j,..) format, so these cases were left unhandled
  4. Some are about infinite loops generation. Obviously, an infinite execution can't be tested and these cases were left unhandled.

First I added a test mode, execution, which directly compare executions for every test instead of trying source comparison first. (Just to work on these issues). Then I generated missing .good.c for case 1. And I applied the following solution to the other issues :

  1. Added a special instruction S0, corresponding only to the empty program, so the test does something in the empty program case and still warns if nothing is done in other tests.
  2. Made CLooG ignore statement bodies when it is generating testing code, generating the expected S_(i,j,..) instead.
  3. Made CLooG arbitrarily bound infinite loops when it is generating testing code, making it testable.

And off course generated the corresponding .good.c files. Now every execution comparison test is passing.