You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code causes the copy propagation pass to remove instructions that alter the semantics of the program:
using System;
using System.Diagnostics.Contracts;
class IntContainer {
public int val;
public IntContainer(int i) {
val = i;
}
}
class Test {
public static void ShouldPass() {
var ic = new IntContainer(3);
F(ic);
}
public static void F(IntContainer x) {
IntContainer ic;
ic = x ?? new IntContainer(4);
// ic = x != null ? x : new IntContainer(4);
Contract.Assert(ic != null);
Contract.Assert(x == null ? ic.val == 4 : ic.val == x.val);
}
}
The text was updated successfully, but these errors were encountered:
The following code causes the copy propagation pass to remove instructions that alter the semantics of the program:
The text was updated successfully, but these errors were encountered: