diff options
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfilingFile.c')
-rw-r--r-- | compiler-rt/lib/profile/InstrProfilingFile.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c index bf50c02761d..98d85d9c19d 100644 --- a/compiler-rt/lib/profile/InstrProfilingFile.c +++ b/compiler-rt/lib/profile/InstrProfilingFile.c @@ -214,6 +214,15 @@ int __llvm_profile_write_file(void) { return -1; } + /* Check if there is llvm/runtime versino mismatch. */ + if (GET_VERSION(__llvm_profile_get_version()) != INSTR_PROF_RAW_VERSION) { + PROF_ERR("LLVM Profile: runtime and instrumentation version mismatch : " + "expected %d, but get %d\n", + INSTR_PROF_RAW_VERSION, + (int)GET_VERSION(__llvm_profile_get_version())); + return -1; + } + /* Write the file. */ rc = writeFileWithName(__llvm_profile_CurrentFilename); if (rc) |