summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/profile/instrprof-basic.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/profile/instrprof-basic.c')
-rw-r--r--compiler-rt/test/profile/instrprof-basic.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/compiler-rt/test/profile/instrprof-basic.c b/compiler-rt/test/profile/instrprof-basic.c
index 3db083140bf..2356fb73ba3 100644
--- a/compiler-rt/test/profile/instrprof-basic.c
+++ b/compiler-rt/test/profile/instrprof-basic.c
@@ -3,10 +3,29 @@
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
-int main(int argc, const char *argv[]) {
+int begin(int i) {
// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
+ if (i)
+ return 0;
+ return 1;
+}
+
+int end(int i) {
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !2
+ if (i)
+ return 0;
+ return 1;
+}
+
+int main(int argc, const char *argv[]) {
+ begin(0);
+ end(1);
+
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !2
if (argc)
return 0;
return 1;
}
-// CHECK: !1 = metadata !{metadata !"branch_weights", i32 2, i32 1}
+
+// CHECK: !1 = metadata !{metadata !"branch_weights", i32 1, i32 2}
+// CHECK: !2 = metadata !{metadata !"branch_weights", i32 2, i32 1}
OpenPOWER on IntegriCloud