Added zero-initialise benchmark.
authorDan Lewis <dan@mono-cvs.ximian.com>
Sat, 11 May 2002 05:45:55 +0000 (05:45 -0000)
committerDan Lewis <dan@mono-cvs.ximian.com>
Sat, 11 May 2002 05:45:55 +0000 (05:45 -0000)
svn path=/trunk/mono/; revision=4520

mono/benchmark/initlocals.cs [new file with mode: 0644]

diff --git a/mono/benchmark/initlocals.cs b/mono/benchmark/initlocals.cs
new file mode 100644 (file)
index 0000000..dc7b373
--- /dev/null
@@ -0,0 +1,33 @@
+// Foo() benefits from definite assignment analysis
+
+using System;
+
+class Test {
+       static void Foo () {
+               int a, b, c, d, e, f, g;
+               int h, i, j, k, l, m, n;
+
+               for (int x = 0; x < 2; ++x) {
+                       a = 0;
+                       b = a;
+                       c = a;
+                       d = b;
+                       e = c;
+                       f = 1;
+                       g = 2;
+                       h = a + b;
+                       i = h + h;
+                       j = 1 + b + c;
+                       k = i + j;
+                       l = f + g;
+                       m = k + l;
+                       n = l + l;
+               }
+       }
+               
+
+       static void Main () {
+               for (int i = 0; i < 100000000; ++ i)
+                       Foo ();
+       }
+}