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
|
2017-04-28 01:30:58 +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 2>&1 | FileCheck %s -check-prefix=NO_MISSING
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-outdated-data.c %s -o /dev/null -emit-llvm -Wprofile-instr-missing -fprofile-instrument-use-path=%t.profdata 2>&1 | FileCheck %s -check-prefix=WITH_MISSING
|
|
|
|
|
2017-11-15 07:56:53 +08:00
|
|
|
// NO_MISSING: warning: profile data may be out of date: of 3 functions, 2 have mismatched data that will be ignored
|
2017-04-28 01:30:58 +08:00
|
|
|
// NO_MISSING-NOT: 1 has no data
|
|
|
|
|
2017-11-15 07:56:53 +08:00
|
|
|
// WITH_MISSING: warning: profile data may be out of date: of 3 functions, 2 have mismatched data that will be ignored
|
2017-04-28 01:30:58 +08:00
|
|
|
// WITH_MISSING: warning: profile data may be incomplete: of 3 functions, 1 has no data
|
2014-03-11 14:49:34 +08:00
|
|
|
|
|
|
|
void no_usable_data() {
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
if (i) {}
|
2014-04-16 05:22:35 +08:00
|
|
|
}
|
2014-03-11 14:49:34 +08:00
|
|
|
|
2014-04-16 05:22:35 +08:00
|
|
|
void no_data() {
|
2014-03-11 14:49:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, const char *argv[]) {
|
|
|
|
no_usable_data();
|
|
|
|
return 0;
|
|
|
|
}
|