diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Basic/UsedEnumIsKept.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Basic/UsedEnumIsKept.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Basic/UsedEnumIsKept.cs b/test/Mono.Linker.Tests.Cases/Basic/UsedEnumIsKept.cs new file mode 100644 index 000000000..5320ce63d --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/Basic/UsedEnumIsKept.cs @@ -0,0 +1,39 @@ +using System; +using System.Reflection; +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.Basic { + class UsedEnumIsKept { + static void Main () + { + // Use all of the values in case we implement a feature in the future that removes unused values + HelperAsEnum (Used.One); + HelperAsEnum (Used.Two); + HelperAsObject (Used.Three); + } + + [Kept] + static void HelperAsEnum (Used arg) + { + } + + [Kept] + static void HelperAsObject (object arg) + { + } + + [Kept] + [KeptMember ("value__")] + [KeptBaseType (typeof(Enum))] + enum Used { + [Kept] + One, + + [Kept] + Two, + + [Kept] + Three + } + } +} |