summaryrefslogtreecommitdiffstats
path: root/clang/test/Profile/c-outdated-data.c
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-03-11 06:49:34 +0000
committerJustin Bogner <mail@justinbogner.com>2014-03-11 06:49:34 +0000
commitffaa2330b9d51fa3705b779b55fa841b367c8bba (patch)
treed6b24cd9b8f31426ffe5af482d13e31071682bd0 /clang/test/Profile/c-outdated-data.c
parent0e18ed2ebaab77dbb13a71c2b70cdf74aaac8b0a (diff)
downloadbcm5719-llvm-ffaa2330b9d51fa3705b779b55fa841b367c8bba.tar.gz
bcm5719-llvm-ffaa2330b9d51fa3705b779b55fa841b367c8bba.zip
test: Regenerate profile data for PGO tests
Some of this data had gotten out of date, so we weren't quite testing what we thought we were. This also moves the outdated data test to its own file to simplify regenerating the test data. llvm-svn: 203546
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