C#: Add ref field test case.

This commit is contained in:
Michael Nebel
2023-01-27 08:45:21 +01:00
parent ecadb56419
commit 478474bbed
3 changed files with 27 additions and 2 deletions

View File

@@ -612,6 +612,24 @@ Strings.cs:
# 53| 1: [StringLiteralUtf8] "The nested message
# 53| is UTF-8 encoded and
# 53| spans multiple lines."
Struct.cs:
# 1| [NamespaceDeclaration] namespace ... { ... }
# 3| 1: [Class] MyEmptyClass
# 5| 2: [Struct] RefStruct
# 7| 5: [Field] MyInt
# 7| -1: [TypeMention] int
# 8| 6: [Field] MyByte
# 8| -1: [TypeMention] byte
# 9| 7: [Field] MyObject
# 9| -1: [TypeMention] object
# 10| 8: [Field] MyEmptyClass
# 10| -1: [TypeMention] MyEmptyClass
# 11| 9: [Field] MyReadonlyByte
# 11| -1: [TypeMention] byte
# 12| 10: [Field] MyReadonlyObject
# 12| -1: [TypeMention] object
# 13| 11: [Field] MyReadonlyString
# 13| -1: [TypeMention] string
cil/class1.cs:
# 4| [Class] Class1
# 6| 5: [Method] Main

View File

@@ -1,5 +1,4 @@
// TODO: Test needs to be enabled when .NET 7 is used as the runtime.
namespace structassembly;
namespace structassembly;
public class MyEmptyClass { }

View File

@@ -1,3 +1,11 @@
reffields
| Struct.cs:8:21:8:26 | MyByte |
| Struct.cs:9:23:9:30 | MyObject |
| Struct.cs:10:31:10:42 | MyEmptyClass |
| Struct.cs:12:32:12:47 | MyReadonlyObject |
readonlyreffields
| Struct.cs:11:30:11:43 | MyReadonlyByte |
| Struct.cs:13:41:13:56 | MyReadonlyString |
readonlyfield
| Struct.cs:12:32:12:47 | MyReadonlyObject |
| Struct.cs:13:41:13:56 | MyReadonlyString |