2014-03-11 14:49:34 +08:00
|
|
|
// Test that outdated data is ignored.
|
|
|
|
|
2014-04-16 05:22:35 +08:00
|
|
|
// FIXME: It would be nice to use -verify here instead of FileCheck, but -verify
|
|
|
|
// doesn't play well with warnings that have no line number.
|
2014-03-11 14:49:34 +08:00
|
|
|
|
2014-04-18 06:49:06 +08:00
|
|
|
// RUN: llvm-profdata merge %S/Inputs/c-outdated-data.proftext -o %t.profdata
|
2016-03-03 04:59:36 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-outdated-data.c %s -o /dev/null -emit-llvm -fprofile-instrument-use-path=%t.profdata -Wprofile-instr-dropped 2>&1 | FileCheck %s
|
2014-04-16 05:22:35 +08:00
|
|
|
// CHECK: warning: profile data may be out of date: of 3 functions, 1 has no data and 1 has mismatched data that will be ignored
|
2014-03-11 14:49:34 +08:00
|
|
|
|
|
|
|
void no_usable_data() {
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
if (i) {}
|
|
|
|
|
|
|
|
#ifdef GENERATE_OUTDATED_DATA
|
|
|
|
if (i) {}
|
|
|
|
#endif
|
2014-04-16 05:22:35 +08:00
|
|
|
}
|
2014-03-11 14:49:34 +08:00
|
|
|
|
2014-04-16 05:22:35 +08:00
|
|
|
#ifndef GENERATE_OUTDATED_DATA
|
|
|
|
void no_data() {
|
2014-03-11 14:49:34 +08:00
|
|
|
}
|
2014-04-16 05:22:35 +08:00
|
|
|
#endif
|
2014-03-11 14:49:34 +08:00
|
|
|
|
|
|
|
int main(int argc, const char *argv[]) {
|
|
|
|
no_usable_data();
|
|
|
|
return 0;
|
|
|
|
}
|