[cfe-dev] Clang codegen tests and LLVM passes

Roman Lebedev via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 16 11:02:36 PDT 2019


Hello.

This was brought up several times now, but looks like it needs to be
mentioned more globally. Clang has many (~1516) front-end codegen tests.
Out of those tests, 364 tests are likely "broken":
$ clang/test$ grep -rl " -O[1-3]" | wc -l
364

Clang codegen tests should not be checking anything more than
clang IR codegen itself. They should not be testing the asm output.
They should not be invoking any middle-end optimization passes.

I suspect some of those 364 tests are as fragile.
It would be great if no new tests would have this design issue.
It would also be great to reduce the number of such tests.

In particular, this time i stumbled into this with
https://reviews.llvm.org/D67318
that broke clang/test/CodeGen/arm_acle.c
Given the nature of that test (it doesn't just greedily check too much, so it
could be relaxed to still pass, it basically contains end-to-end testing
for certain ARM intrinsics) so it can't really be relaxed.
I had to disable that test as i'm not sure how it should be fixed.

Roman.


More information about the cfe-dev mailing list