aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/sandbox
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2019-07-12 12:13:42 +0200
committerCyril SIX <cyril.six@kalray.eu>2019-07-12 12:13:42 +0200
commitb0e471b332fbc8607eee738677e4d5dd75bf1777 (patch)
treef7088ebf91e0db4aa0b9a71d3ca73dbde233738e /test/monniaux/sandbox
parent4f6fd68084b4d3a7544e166b2c24524464efb626 (diff)
downloadcompcert-kvx-b0e471b332fbc8607eee738677e4d5dd75bf1777.tar.gz
compcert-kvx-b0e471b332fbc8607eee738677e4d5dd75bf1777.zip
(#143) much simpler example to measure how our measures affect performance
Diffstat (limited to 'test/monniaux/sandbox')
-rw-r--r--test/monniaux/sandbox/example.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/monniaux/sandbox/example.c b/test/monniaux/sandbox/example.c
index dccb576e..ce35360a 100644
--- a/test/monniaux/sandbox/example.c
+++ b/test/monniaux/sandbox/example.c
@@ -2,6 +2,7 @@
#include "f.h"
#include "../cycles.h"
+#if 0
int main(void){
cycle_count_config();
@@ -20,3 +21,20 @@ int main(void){
TIMEPRINT(1)
return 0;
}
+#endif
+
+int main(void){
+ cycle_count_config();
+
+ TIMEINIT
+ int a = 42;
+ int b = 21;
+ int c = 42+b;
+ TIMESTOP(0)
+ int d = a + b;
+ int e = a + b + c + d;
+ TIMESTOP(1)
+
+ TIMEPRINT(1)
+ return e;
+}