aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/latency
diff options
context:
space:
mode:
Diffstat (limited to 'test/monniaux/latency')
-rw-r--r--test/monniaux/latency/latency.s27
-rw-r--r--test/monniaux/latency/show_latency.c11
2 files changed, 38 insertions, 0 deletions
diff --git a/test/monniaux/latency/latency.s b/test/monniaux/latency/latency.s
new file mode 100644
index 00000000..494f9f77
--- /dev/null
+++ b/test/monniaux/latency/latency.s
@@ -0,0 +1,27 @@
+# File generated by CompCert 3.4
+# Command line: -S latency.c
+ .text
+ .balign 2
+ .globl latency
+latency:
+ make $r2 = 100
+;;
+ loopdo $r2, .exitloop
+;;
+ lws $r1 = 0[$r0]
+;;
+ addw $r0 = $r0, 0
+;;
+ addw $r0 = $r0, 0
+;;
+ addw $r0 = $r0, 0
+;;
+ addw $r1 = $r1, 1
+;;
+ sw 0[$r0] = $r1
+;;
+.exitloop:
+ ret
+;;
+ .type latency, @function
+ .size latency, . - latency
diff --git a/test/monniaux/latency/show_latency.c b/test/monniaux/latency/show_latency.c
new file mode 100644
index 00000000..3269450a
--- /dev/null
+++ b/test/monniaux/latency/show_latency.c
@@ -0,0 +1,11 @@
+#include "../clock.h"
+
+extern void latency(int *p);
+
+int main() {
+ int x;
+ clock_start();
+ latency(&x);
+ clock_stop();
+ print_total_clock();
+}