aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/predict-18.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/predict-18.c')
-rw-r--r--gcc/testsuite/gcc.dg/predict-18.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/predict-18.c b/gcc/testsuite/gcc.dg/predict-18.c
index 0c93638..073e742 100644
--- a/gcc/testsuite/gcc.dg/predict-18.c
+++ b/gcc/testsuite/gcc.dg/predict-18.c
@@ -8,6 +8,8 @@ int x;
short v = 0;
short expected = 0;
short max = ~0;
+short m = 0;
+short n = 0;
#define STRONG 0
void foo (int a, int b)
@@ -23,9 +25,17 @@ void foo (int a, int b)
if (__builtin_expect_with_probability (a < 10, 1, 0.9f) > __builtin_expect_with_probability (b, 0, 0.8f))
global++;
+
+ if (a * __builtin_expect_with_probability (m, 0, 0.6f) > 0)
+ global++;
+
+ if (__builtin_expect_with_probability (n, 0, 0.65f) * a > 0)
+ global++;
}
/* { dg-final { scan-tree-dump "__builtin_expect_with_probability heuristics of edge .*->.*: 54.00%" "profile_estimate"} } */
/* { dg-final { scan-tree-dump "__builtin_expect_with_probability heuristics of edge .*->.*: 77.70%" "profile_estimate"} } */
/* { dg-final { scan-tree-dump "__builtin_expect_with_probability heuristics of edge .*->.*: 98.96%" "profile_estimate"} } */
/* { dg-final { scan-tree-dump "__builtin_expect_with_probability heuristics of edge .*->.*: 71.99%" "profile_estimate"} } */
+/* { dg-final { scan-tree-dump "__builtin_expect_with_probability heuristics of edge .*->.*: 40.00%" "profile_estimate"} } */
+/* { dg-final { scan-tree-dump "__builtin_expect_with_probability heuristics of edge .*->.*: 35.01%" "profile_estimate"} } */