Page MenuHomePhabricator

[test] Add Clang side tests for -fdebug-info-for-profiling
ClosedPublic

Authored by MaskRay on Sun, Jan 10, 5:44 PM.

Details

Summary

There is currently a driver test but no test for its effect on linkageName & pass pipeline.

Diff Detail

Event Timeline

MaskRay requested review of this revision.Sun, Jan 10, 5:44 PM
MaskRay created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSun, Jan 10, 5:44 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dblaikie added inline comments.Tue, Jan 12, 12:17 PM
clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
15–17

What's this test for? (I'd hesitate to add a test that has to run llvm-profdata and use that profile, etc) I guess it's a different codepath that sets up the pass pipeline for this case compared to the previous case?

MaskRay added inline comments.Tue, Jan 12, 12:27 PM
clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
15–17

Test that -fdebug-info-for-profiling affects both driver -fprofile-use (CC1 -fprofile-instrument-use-path) and driver -fprofile-generate (CC1 -fprofile-instrument-path). IIUC: generate/use needs to have compatible flags so that their CFG is identical.

The profile reading pass will error on an invalid file (e.g. an empty file).

I hesitated a bit for the usage of llvm-profdata, but I searched for llvm-profdata and there are 20+ other tests using llvm-profdata so I believe it is fine.

dblaikie accepted this revision.Tue, Jan 12, 12:34 PM

Sounds good

This revision is now accepted and ready to land.Tue, Jan 12, 12:34 PM

Verified with @wmi offline this is good. Committing...