This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Replace test/CodeGen/thinlto_backend.c with a functional test.

Authored by pcc on Jun 20 2016, 5:43 PM.



This new test tests that functions are capable of being imported, rather than
that the import pass is run. This new test is compatible with the approach
being developed in D20268 which runs the importer on its own rather than in
a pass.

Diff Detail


Event Timeline

pcc updated this revision to Diff 61328.Jun 20 2016, 5:43 PM
pcc retitled this revision from to CodeGen: Replace test/CodeGen/thinlto_backend.c with a functional test..
pcc updated this object.
pcc added a reviewer: tejohnson.
pcc added a subscriber: cfe-commits.
tejohnson accepted this revision.Jun 20 2016, 8:01 PM
tejohnson edited edge metadata.

LGTM but with one question: Any issue with IR tests in clang tests? I noticed that there are very few (although there is already one existing .ll in test/CodeGen).

This revision is now accepted and ready to land.Jun 20 2016, 8:01 PM
pcc added a comment.Jun 21 2016, 6:03 PM

Should be fine. This is testing an unusual feature of clang that takes IR as input, so IR is the appropriate input type here.

This revision was automatically updated to reflect the committed changes.

Why is this in clang rather than in llvm?

pcc added a comment.Jun 24 2016, 3:41 PM

This is testing a clang feature that reads IR and runs the ThinLTO backend. This feature is part of ThinLTO's distributed build support (search for "Distributed Build Support" in

In a future change I want to replace the clang-side code here with a client of a new LTO interface that takes IR and produces object files (see D21545). So I think testing the object file is the right approach here.

OK, that works for me. :)