Justin Bogner | ffaa233 | 2014-03-11 06:49:34 +0000 | [diff] [blame^] | 1 | // Test that outdated data is ignored. |
| 2 | |
| 3 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-outdated-data.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-outdated-data.profdata | FileCheck -check-prefix=PGOUSE %s |
| 4 | |
| 5 | // TODO: We should have a warning or a remark that tells us the profile data was |
| 6 | // discarded, rather than just checking that we fail to add metadata. |
| 7 | |
| 8 | // PGOUSE-LABEL: @no_usable_data() |
| 9 | void no_usable_data() { |
| 10 | int i = 0; |
| 11 | |
| 12 | if (i) {} |
| 13 | |
| 14 | #ifdef GENERATE_OUTDATED_DATA |
| 15 | if (i) {} |
| 16 | #endif |
| 17 | |
| 18 | // PGOUSE-NOT: br {{.*}} !prof ![0-9]+ |
| 19 | } |
| 20 | |
| 21 | int main(int argc, const char *argv[]) { |
| 22 | no_usable_data(); |
| 23 | return 0; |
| 24 | } |