Skip to content

Commit d92b226

Browse files
committed
C#: Add test example for unsigned right shift assignment in intermediate representation.
1 parent 5bb8f8e commit d92b226

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

csharp/ql/test/experimental/ir/ir/PrintAst.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ assignop.cs:
171171
# 19| 0: [AssignOrExpr] ... |= ...
172172
# 19| 0: [LocalVariableAccess] access to local variable c
173173
# 19| 1: [IntLiteral] 2
174+
# 20| 12: [ExprStmt] ...;
175+
# 20| 0: [AssignUnsighedRightShiftExpr] ... >>>= ...
176+
# 20| 0: [LocalVariableAccess] access to local variable c
177+
# 20| 1: [IntLiteral] 2
174178
casts.cs:
175179
# 1| [Class] Casts_A
176180
# 5| [Class] Casts_B

csharp/ql/test/experimental/ir/ir/assignop.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ static void Main()
1717
c &= 2;
1818
c ^= 2;
1919
c |= 2;
20+
c >>>= 2;
2021
}
2122
}

csharp/ql/test/experimental/ir/ir/raw_ir.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ assignop.cs:
210210
# 19| r19_3(Int32) = Load[c] : &:r19_2, ~m?
211211
# 19| r19_4(Int32) = BitOr : r19_3, r19_1
212212
# 19| mu19_5(Int32) = Store[c] : &:r19_2, r19_4
213+
# 20| r20_1(Int32) = Constant[2] :
214+
# 20| r20_2(glval<Int32>) = VariableAddress[c] :
215+
# 20| r20_3(Int32) = Load[c] : &:r20_2, ~m?
216+
# 20| r20_4(Int32) = UnsignedShiftRight : r20_3, r20_1
217+
# 20| mu20_5(Int32) = Store[c] : &:r20_2, r20_4
213218
# 5| v5_3(Void) = ReturnVoid :
214219
# 5| v5_4(Void) = AliasedUse : ~m?
215220
# 5| v5_5(Void) = ExitFunction :

0 commit comments

Comments
 (0)