aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/expect/expect.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/monniaux/expect/expect.c')
-rw-r--r--test/monniaux/expect/expect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/monniaux/expect/expect.c b/test/monniaux/expect/expect.c
new file mode 100644
index 00000000..30e0742a
--- /dev/null
+++ b/test/monniaux/expect/expect.c
@@ -0,0 +1,7 @@
+#ifndef PREDICTED
+#define PREDICTED 0
+#endif
+
+int expect(int x, int *y, int *z) {
+ return __builtin_expect(x, PREDICTED) ? *y : *z;
+}