llvm-project/clang/test/Profile
Aiden Grossman c0bc461999 [Clang] Give error message for invalid profile path when compiling IR
Before this patch, when compiling an IR file (eg the .llvmbc section
from an object file compiled with -Xclang -fembed-bitcode=all) and
profile data was passed in using the -fprofile-instrument-use-path
flag, there would be no error printed (as the previous implementation
relied on the error getting caught again in the constructor of
CodeGenModule which isn't called when -x ir is set). This patch
moves the error checking directly to where the error is caught
originally rather than failing silently in setPGOUseInstrumentor and
waiting to catch it in CodeGenModule to print diagnostic information to
the user.

Regression test added.

Reviewed By: xur, mtrofin

Differential Revision: https://reviews.llvm.org/D132991
2022-09-16 19:45:57 +00:00
..
Inputs [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
README
branch-logical-mixed.cpp [InstrProf] Use i32 for GEP index from lowering llvm.instrprof.increment 2021-11-19 15:45:14 -08:00
branch-profdup.cpp
c-avoid-direct-call.c [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00
c-captured.c [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
c-collision.c Use functions with prototypes when appropriate; NFC 2022-02-12 07:25:06 -05:00
c-counter-overflows.c
c-general.c [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
c-generate.c
c-indirect-call.c [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00
c-linkage-available_externally.c [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
c-linkage.c Revert test fixups after e9a9c85098 (which reverted a14fc74). 2021-06-04 10:42:25 -04:00
c-outdated-data.c Use functions with prototypes when appropriate; NFC 2022-02-12 07:25:06 -05:00
c-ternary.c [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
c-unprofiled-blocks.c [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
c-unprofiled.c
c-unreachable-after-switch.c [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
coverage-prefix-map.c Use functions with prototypes when appropriate; NFC 2022-02-12 07:25:06 -05:00
cxx-abc-deleting-dtor.cpp [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
cxx-class.cpp [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
cxx-hash-v2.cpp
cxx-implicit.cpp
cxx-indirect-call.cpp [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00
cxx-lambda.cpp [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
cxx-linkage.cpp Revert test fixups after e9a9c85098 (which reverted a14fc74). 2021-06-04 10:42:25 -04:00
cxx-missing-bodies.cpp
cxx-rangefor.cpp [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
cxx-stmt-initializers.cpp [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
cxx-structors.cpp
cxx-templates.cpp [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
cxx-throws.cpp [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
cxx-virtual-destructor-calls.cpp
def-assignop.cpp
def-ctors.cpp
def-dtors.cpp
func-entry.c
gcc-flag-compatibility-aix.c Use functions with prototypes when appropriate; NFC 2022-02-12 07:25:06 -05:00
gcc-flag-compatibility.c Use functions with prototypes when appropriate; NFC 2022-02-12 07:25:06 -05:00
misexpect-branch-cold.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
misexpect-branch-nonconst-expected-val.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
misexpect-branch-unpredictable.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
misexpect-branch.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
misexpect-switch-default.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
misexpect-switch-nonconst.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
misexpect-switch-only-default-case.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
misexpect-switch.c [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
objc-general.m [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
profile-does-not-exist-ir.c [Clang] Give error message for invalid profile path when compiling IR 2022-09-16 19:45:57 +00:00
profile-does-not-exist.c [Clang] Give error message for invalid profile path when compiling IR 2022-09-16 19:45:57 +00:00
profile-summary.c

README

These are tests for instrumentation based profiling.  This specifically means
the -fprofile-instr-generate and -fprofile-instr-use driver flags.

Tests in this directory should usually test both:

  - the generation of instrumentation (-fprofile-instr-generate), and
  - the use of profile data from instrumented runs (-fprofile-instr-use).

In order to test -fprofile-instr-use without actually running an instrumented
program, .profdata files are checked into Inputs/.

The input source files must include a main function such that building with
-fprofile-instr-generate and running the resulting program generates the same
.profdata file that is consumed by the tests for -fprofile-instr-use.  Even
tests that only check -fprofile-instr-use should include such a main function,
so that profile data can be regenerated as the .profdata file format evolves.