some nice little micro-benchmarks
[mono.git] / mono / benchmark / commute.cs
diff --git a/mono/benchmark/commute.cs b/mono/benchmark/commute.cs
new file mode 100644 (file)
index 0000000..00dff80
--- /dev/null
@@ -0,0 +1,37 @@
+using System;
+
+class A {
+       static int Main ()
+       {
+               int a = 0;
+               
+               for (int i = 0; i < 50000000; i++) {
+                       
+                       
+                       a = 
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+                               (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7)))))))))))))))))));
+               }
+               
+               // no ssa
+               return a != (a + 1) ? 0 : 1;
+       }
+       
+       static void Foo (out int dummy) { dummy = 0; }
+}
\ No newline at end of file