[PATCH] D15171: Test case to verify the presence of MaxFunctionCount module flag in PGO mode

Easwaran Raman via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 17:21:49 PST 2015


eraman created this revision.
eraman added a reviewer: davidxl.
eraman added a subscriber: llvm-commits.
eraman set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

http://reviews.llvm.org/D15171

Files:
  test/profile/instrprof-max-function-count.c

Index: test/profile/instrprof-max-function-count.c
===================================================================
--- /dev/null
+++ test/profile/instrprof-max-function-count.c
@@ -0,0 +1,24 @@
+// RUN: %clang_profgen -o %t -O2 %s
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata merge -o %t.profdata %t.profraw
+// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
+
+int begin(int i) {
+  if (i)
+    return 0;
+  return 1;
+}
+
+int end(int i) {
+  if (i)
+    return 0;
+  return 1;
+}
+
+int main(int argc, const char *argv[]) {
+  begin(0);
+  end(1);
+  end(1);
+  return 0;
+}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"MaxFunctionCount", i32 2}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15171.41698.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151203/ca950178/attachment.bin>


More information about the llvm-commits mailing list