Skip to content

Commit c7d6c42

Browse files
committed
C#: Add underlying enum type test for CIL extraction
1 parent ec573b5 commit c7d6c42

File tree

3 files changed

+254
-0
lines changed

3 files changed

+254
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// semmle-extractor-options: --cil
2+
3+
using System;
4+
5+
class Test
6+
{
7+
static void Main(string[] args)
8+
{
9+
}
10+
}
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
| Interop.Advapi32.ActivityControl | int |
2+
| Interop.BOOL | int |
3+
| Interop.Error | int |
4+
| Interop.Globalization.ResultCode | int |
5+
| Interop.Globalization.TimeZoneDisplayNameType | int |
6+
| Interop.Sys.AccessMode | int |
7+
| Interop.Sys.ControlCharacterNames | int |
8+
| Interop.Sys.CtrlCode | int |
9+
| Interop.Sys.FileAdvice | int |
10+
| Interop.Sys.FileStatusFlags | int |
11+
| Interop.Sys.LockOperations | int |
12+
| Interop.Sys.NodeType | int |
13+
| Interop.Sys.OpenFlags | int |
14+
| Interop.Sys.PollEvents | int |
15+
| Interop.Sys.SeekWhence | int |
16+
| Interop.Sys.SysConfName | int |
17+
| Interop.Sys.SysLogPriority | int |
18+
| System.AttributeTargets | int |
19+
| System.Base64FormattingOptions | int |
20+
| System.Buffers.ArrayPoolEventSource.BufferAllocatedReason | int |
21+
| System.Buffers.OperationStatus | int |
22+
| System.Buffers.Text.FormattingHelpers.HexCasing | int |
23+
| System.Buffers.Text.Utf8Parser.ComponentParseResult | int |
24+
| System.Buffers.Text.Utf8Parser.ParseNumberOptions | int |
25+
| System.Buffers.TlsOverPerCoreLockedStacksArrayPool.MemoryPressure | int |
26+
| System.Collections.Generic.InsertionBehavior | int |
27+
| System.ComponentModel.EditorBrowsableState | int |
28+
| System.Configuration.Assemblies.AssemblyHashAlgorithm | int |
29+
| System.Configuration.Assemblies.AssemblyVersionCompatibility | int |
30+
| System.ConsoleColor | int |
31+
| System.ConsoleKey | int |
32+
| System.ConsoleModifiers | int |
33+
| System.ConsoleSpecialKey | int |
34+
| System.DTSubStringType | int |
35+
| System.DateTimeKind | int |
36+
| System.DateTimeParse.DS | int |
37+
| System.DateTimeParse.DTT | int |
38+
| System.DateTimeParse.TM | int |
39+
| System.DayOfWeek | int |
40+
| System.DefaultBinder.Primitives | int |
41+
| System.DelegateBindingFlags | int |
42+
| System.Diagnostics.Contracts.ContractFailureKind | int |
43+
| System.Diagnostics.DebuggableAttribute.DebuggingModes | int |
44+
| System.Diagnostics.DebuggerBrowsableState | int |
45+
| System.Diagnostics.StackTrace.TraceFormat | int |
46+
| System.Diagnostics.SymbolStore.SymAddressKind | int |
47+
| System.Diagnostics.Tracing.ControllerCommand | int |
48+
| System.Diagnostics.Tracing.EventActivityOptions | int |
49+
| System.Diagnostics.Tracing.EventChannel | int |
50+
| System.Diagnostics.Tracing.EventChannelType | int |
51+
| System.Diagnostics.Tracing.EventCommand | int |
52+
| System.Diagnostics.Tracing.EventFieldFormat | int |
53+
| System.Diagnostics.Tracing.EventFieldTags | int |
54+
| System.Diagnostics.Tracing.EventKeywords | int |
55+
| System.Diagnostics.Tracing.EventLevel | int |
56+
| System.Diagnostics.Tracing.EventManifestOptions | int |
57+
| System.Diagnostics.Tracing.EventOpcode | int |
58+
| System.Diagnostics.Tracing.EventPipeSerializationFormat | int |
59+
| System.Diagnostics.Tracing.EventProvider.WriteEventErrorCode | int |
60+
| System.Diagnostics.Tracing.EventProviderType | int |
61+
| System.Diagnostics.Tracing.EventSourceSettings | int |
62+
| System.Diagnostics.Tracing.EventTags | int |
63+
| System.Diagnostics.Tracing.EventTask | int |
64+
| System.Diagnostics.Tracing.ManifestEnvelope.ManifestFormats | int |
65+
| System.Diagnostics.Tracing.TraceLoggingDataType | int |
66+
| System.Enum | int |
67+
| System.Environment.SpecialFolder | int |
68+
| System.Environment.SpecialFolderOption | int |
69+
| System.EnvironmentVariableTarget | int |
70+
| System.Exception.ExceptionMessageKind | int |
71+
| System.ExceptionArgument | int |
72+
| System.ExceptionResource | int |
73+
| System.GC.EndNoGCRegionStatus | int |
74+
| System.GC.StartNoGCRegionStatus | int |
75+
| System.GCCollectionMode | int |
76+
| System.GCNotificationStatus | int |
77+
| System.Globalization.BidiCategory | int |
78+
| System.Globalization.CalendarAlgorithmType | int |
79+
| System.Globalization.CalendarDataType | int |
80+
| System.Globalization.CalendarId | int |
81+
| System.Globalization.CalendarWeekRule | int |
82+
| System.Globalization.CalendricalCalculationsHelper.CorrectionAlgorithm | int |
83+
| System.Globalization.CompareOptions | int |
84+
| System.Globalization.CultureData.LocaleGroupingData | int |
85+
| System.Globalization.CultureData.LocaleNumberData | int |
86+
| System.Globalization.CultureData.LocaleStringData | int |
87+
| System.Globalization.CultureTypes | int |
88+
| System.Globalization.DateTimeFormatFlags | int |
89+
| System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern | int |
90+
| System.Globalization.DateTimeStyles | int |
91+
| System.Globalization.DigitShapes | int |
92+
| System.Globalization.FORMATFLAGS | int |
93+
| System.Globalization.GregorianCalendarTypes | int |
94+
| System.Globalization.HebrewNumber.HS | int |
95+
| System.Globalization.HebrewNumber.HebrewToken | int |
96+
| System.Globalization.HebrewNumberParsingState | int |
97+
| System.Globalization.LocaleDataParts | int |
98+
| System.Globalization.MonthNameStyles | int |
99+
| System.Globalization.NumberStyles | int |
100+
| System.Globalization.TextInfo.Tristate | int |
101+
| System.Globalization.TimeSpanFormat.StandardFormat | int |
102+
| System.Globalization.TimeSpanParse.TTT | int |
103+
| System.Globalization.TimeSpanParse.TimeSpanStandardStyles | int |
104+
| System.Globalization.TimeSpanStyles | int |
105+
| System.Globalization.UnicodeCategory | int |
106+
| System.Guid.GuidParseThrowStyle | int |
107+
| System.IO.FileAccess | int |
108+
| System.IO.FileAttributes | int |
109+
| System.IO.FileMode | int |
110+
| System.IO.FileOptions | int |
111+
| System.IO.FileShare | int |
112+
| System.IO.HandleInheritability | int |
113+
| System.IO.SeekOrigin | int |
114+
| System.LazyState | int |
115+
| System.MidpointRounding | int |
116+
| System.Number.NumberBufferKind | int |
117+
| System.Number.ParsingStatus | int |
118+
| System.ParseFailureKind | int |
119+
| System.ParseFlags | int |
120+
| System.PlatformID | int |
121+
| System.Reflection.AssemblyContentType | int |
122+
| System.Reflection.AssemblyNameFlags | int |
123+
| System.Reflection.Associates.Attributes | int |
124+
| System.Reflection.BindingFlags | int |
125+
| System.Reflection.CallingConventions | int |
126+
| System.Reflection.CorElementType | int |
127+
| System.Reflection.CustomAttributeEncoding | int |
128+
| System.Reflection.Emit.AssemblyBuilderAccess | int |
129+
| System.Reflection.Emit.DynamicResolver.SecurityControlFlags | int |
130+
| System.Reflection.Emit.FlowControl | int |
131+
| System.Reflection.Emit.OpCodeType | int |
132+
| System.Reflection.Emit.OpCodeValues | int |
133+
| System.Reflection.Emit.OperandType | int |
134+
| System.Reflection.Emit.PEFileKinds | int |
135+
| System.Reflection.Emit.PackingSize | int |
136+
| System.Reflection.Emit.ScopeAction | int |
137+
| System.Reflection.Emit.StackBehaviour | int |
138+
| System.Reflection.Emit.TypeKind | int |
139+
| System.Reflection.Emit.TypeNameBuilder.Format | int |
140+
| System.Reflection.EventAttributes | int |
141+
| System.Reflection.ExceptionHandlingClauseOptions | int |
142+
| System.Reflection.FieldAttributes | int |
143+
| System.Reflection.GenericParameterAttributes | int |
144+
| System.Reflection.INVOCATION_FLAGS | int |
145+
| System.Reflection.ImageFileMachine | int |
146+
| System.Reflection.MdSigCallingConvention | int |
147+
| System.Reflection.MemberTypes | int |
148+
| System.Reflection.MetadataTokenType | int |
149+
| System.Reflection.MethodAttributes | int |
150+
| System.Reflection.MethodImplAttributes | int |
151+
| System.Reflection.MethodSemanticsAttributes | int |
152+
| System.Reflection.PInvokeAttributes | int |
153+
| System.Reflection.ParameterAttributes | int |
154+
| System.Reflection.PortableExecutableKinds | int |
155+
| System.Reflection.ProcessorArchitecture | int |
156+
| System.Reflection.PropertyAttributes | int |
157+
| System.Reflection.ResourceAttributes | int |
158+
| System.Reflection.ResourceLocation | int |
159+
| System.Reflection.TypeAttributes | int |
160+
| System.Resources.ResourceTypeCode | int |
161+
| System.Resources.UltimateResourceFallbackLocation | int |
162+
| System.Runtime.CompilerServices.CompilationRelaxations | int |
163+
| System.Runtime.CompilerServices.LoadHint | int |
164+
| System.Runtime.CompilerServices.MethodCodeType | int |
165+
| System.Runtime.CompilerServices.MethodImplOptions | int |
166+
| System.Runtime.ConstrainedExecution.Cer | int |
167+
| System.Runtime.ConstrainedExecution.Consistency | int |
168+
| System.Runtime.GCLargeObjectHeapCompactionMode | int |
169+
| System.Runtime.GCLatencyMode | int |
170+
| System.Runtime.GCSettings.SetLatencyModeStatus | int |
171+
| System.Runtime.InteropServices.CallingConvention | int |
172+
| System.Runtime.InteropServices.CharSet | int |
173+
| System.Runtime.InteropServices.ClassInterfaceType | int |
174+
| System.Runtime.InteropServices.ComInterfaceType | int |
175+
| System.Runtime.InteropServices.ComMemberType | int |
176+
| System.Runtime.InteropServices.ComTypes.CALLCONV | int |
177+
| System.Runtime.InteropServices.ComTypes.DESCKIND | int |
178+
| System.Runtime.InteropServices.ComTypes.FUNCFLAGS | int |
179+
| System.Runtime.InteropServices.ComTypes.FUNCKIND | int |
180+
| System.Runtime.InteropServices.ComTypes.IDLFLAG | int |
181+
| System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS | int |
182+
| System.Runtime.InteropServices.ComTypes.INVOKEKIND | int |
183+
| System.Runtime.InteropServices.ComTypes.LIBFLAGS | int |
184+
| System.Runtime.InteropServices.ComTypes.PARAMFLAG | int |
185+
| System.Runtime.InteropServices.ComTypes.SYSKIND | int |
186+
| System.Runtime.InteropServices.ComTypes.TYPEFLAGS | int |
187+
| System.Runtime.InteropServices.ComTypes.TYPEKIND | int |
188+
| System.Runtime.InteropServices.ComTypes.VARFLAGS | int |
189+
| System.Runtime.InteropServices.ComTypes.VARKIND | int |
190+
| System.Runtime.InteropServices.CustomQueryInterfaceMode | int |
191+
| System.Runtime.InteropServices.CustomQueryInterfaceResult | int |
192+
| System.Runtime.InteropServices.DllImportSearchPath | int |
193+
| System.Runtime.InteropServices.GCHandleType | int |
194+
| System.Runtime.InteropServices.LayoutKind | int |
195+
| System.Runtime.InteropServices.UnmanagedType | int |
196+
| System.Runtime.InteropServices.VarEnum | int |
197+
| System.Runtime.Intrinsics.X86.FloatComparisonMode | int |
198+
| System.Runtime.Loader.AssemblyLoadContext.InternalState | int |
199+
| System.Runtime.Serialization.StreamingContextStates | int |
200+
| System.RuntimeType.MemberListType | int |
201+
| System.RuntimeType.RuntimeTypeCache.CacheType | int |
202+
| System.Security.PartialTrustVisibilityLevel | int |
203+
| System.Security.Permissions.PermissionState | int |
204+
| System.Security.Principal.PrincipalPolicy | int |
205+
| System.Security.SecurityCriticalScope | int |
206+
| System.Security.SecurityRuleSet | int |
207+
| System.String.TrimType | int |
208+
| System.StringComparison | int |
209+
| System.StringSplitOptions | int |
210+
| System.StubHelpers.AsAnyMarshaler.BackPropAction | int |
211+
| System.TermInfo.WellKnownNumbers | int |
212+
| System.TermInfo.WellKnownStrings | int |
213+
| System.Text.NormalizationForm | int |
214+
| System.Threading.ApartmentState | int |
215+
| System.Threading.EventResetMode | int |
216+
| System.Threading.LazyThreadSafetyMode | int |
217+
| System.Threading.LockRecursionPolicy | int |
218+
| System.Threading.ReaderWriterLockSlim.EnterLockType | int |
219+
| System.Threading.ReaderWriterLockSlim.EnterSpinLockReason | int |
220+
| System.Threading.ReaderWriterLockSlim.WaiterStates | int |
221+
| System.Threading.StackCrawlMark | int |
222+
| System.Threading.Tasks.ConcurrentExclusiveSchedulerPair.ProcessingMode | int |
223+
| System.Threading.Tasks.InternalTaskOptions | int |
224+
| System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags | int |
225+
| System.Threading.Tasks.Sources.ValueTaskSourceStatus | int |
226+
| System.Threading.Tasks.TaskContinuationOptions | int |
227+
| System.Threading.Tasks.TaskCreationOptions | int |
228+
| System.Threading.Tasks.TaskStatus | int |
229+
| System.Threading.Tasks.TplEventSource.TaskWaitBehavior | int |
230+
| System.Threading.ThreadPriority | int |
231+
| System.Threading.ThreadState | int |
232+
| System.Threading.WaitHandle.OpenExistingResult | int |
233+
| System.TimeZoneInfo.StringSerializer.State | int |
234+
| System.TimeZoneInfo.TZVersion | int |
235+
| System.TimeZoneInfo.TimeZoneInfoResult | int |
236+
| System.TimeZoneInfoOptions | int |
237+
| System.TokenType | int |
238+
| System.TypeCode | int |
239+
| System.TypeNameFormatFlags | int |
240+
| System.TypeNameKind | int |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import semmle.code.cil.Types
2+
3+
from Enum e
4+
select e.getQualifiedName(), e.getUnderlyingType().toStringWithTypes()

0 commit comments

Comments
 (0)