summaryrefslogtreecommitdiffstats
path: root/clang/test/Profile/c-outdated-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Profile/c-outdated-data.c')
-rw-r--r--clang/test/Profile/c-outdated-data.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/Profile/c-outdated-data.c b/clang/test/Profile/c-outdated-data.c
new file mode 100644
index 00000000000..fe5a5c75cca
--- /dev/null
+++ b/clang/test/Profile/c-outdated-data.c
@@ -0,0 +1,24 @@
+// Test that outdated data is ignored.
+
+// 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
+
+// TODO: We should have a warning or a remark that tells us the profile data was
+// discarded, rather than just checking that we fail to add metadata.
+
+// PGOUSE-LABEL: @no_usable_data()
+void no_usable_data() {
+ int i = 0;
+
+ if (i) {}
+
+#ifdef GENERATE_OUTDATED_DATA
+ if (i) {}
+#endif
+
+ // PGOUSE-NOT: br {{.*}} !prof ![0-9]+
+}
+
+int main(int argc, const char *argv[]) {
+ no_usable_data();
+ return 0;
+}
OpenPOWER on IntegriCloud