[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Profile / c-outdated-data.c
blob454e4d799e0bb325b4433fdf5122b42f0cac60a5
1 // Test that outdated data is ignored.
3 // FIXME: It would be nice to use -verify here instead of FileCheck, but -verify
4 // doesn't play well with warnings that have no line number.
6 // RUN: llvm-profdata merge %S/Inputs/c-outdated-data.proftext -o %t.profdata
7 // 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
8 // 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
10 // NO_MISSING: warning: profile data may be out of date: of 3 functions, 2 have mismatched data that will be ignored
11 // NO_MISSING-NOT: 1 has no data
13 // WITH_MISSING: warning: profile data may be out of date: of 3 functions, 2 have mismatched data that will be ignored
14 // WITH_MISSING: warning: profile data may be incomplete: of 3 functions, 1 has no data
16 void no_usable_data(void) {
17 int i = 0;
19 if (i) {}
22 void no_data(void) {
25 int main(int argc, const char *argv[]) {
26 no_usable_data();
27 return 0;