xref: /aosp_15_r20/external/clang/test/Profile/README (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin LiThese are tests for instrumentation based profiling.  This specifically means
2*67e74705SXin Lithe -fprofile-instr-generate and -fprofile-instr-use driver flags.
3*67e74705SXin Li
4*67e74705SXin LiTests in this directory should usually test both:
5*67e74705SXin Li
6*67e74705SXin Li  - the generation of instrumentation (-fprofile-instr-generate), and
7*67e74705SXin Li  - the use of profile data from instrumented runs (-fprofile-instr-use).
8*67e74705SXin Li
9*67e74705SXin LiIn order to test -fprofile-instr-use without actually running an instrumented
10*67e74705SXin Liprogram, .profdata files are checked into Inputs/.
11*67e74705SXin Li
12*67e74705SXin LiThe input source files must include a main function such that building with
13*67e74705SXin Li-fprofile-instr-generate and running the resulting program generates the same
14*67e74705SXin Li.profdata file that is consumed by the tests for -fprofile-instr-use.  Even
15*67e74705SXin Litests that only check -fprofile-instr-use should include such a main function,
16*67e74705SXin Liso that profile data can be regenerated as the .profdata file format evolves.
17