Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
benchmarks: fix checksum for isinst
Browse files Browse the repository at this point in the history
  • Loading branch information
lewurm committed Apr 14, 2016
1 parent 02be72e commit ee360ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/small/isinst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override long foo () {
}
}

static bool bench (long iterations, object[] objs) {
static long bench (long iterations, object[] objs) {
long checksum = 0;
for (long i = 0; i < iterations; ++i) {
foreach (object o in objs) {
Expand All @@ -34,7 +34,7 @@ static bool bench (long iterations, object[] objs) {
}
}
}
return checksum == (4 * iterations);
return checksum;
}

public static void Main (string []args) {
Expand All @@ -46,6 +46,9 @@ public static void Main (string []args) {
objs [3] = new C ();
if (args.Length > 0)
n = Int64.Parse (args[0]);
System.Environment.Exit (bench (n, objs) ? 0 : 1);
long checksum = bench (n, objs);
Console.WriteLine ("iterations: " + n);
Console.WriteLine ("checksum: " + checksum);
System.Environment.Exit (checksum == (11 * n) ? 0 : 1);
}
}
Binary file modified tests/small/isinst.exe
Binary file not shown.

0 comments on commit ee360ef

Please sign in to comment.