Add linker tests
authorMarek Safar <marek.safar@gmail.com>
Thu, 11 May 2017 19:08:25 +0000 (21:08 +0200)
committerMarek Safar <marek.safar@gmail.com>
Thu, 18 May 2017 08:07:38 +0000 (10:07 +0200)
mcs/tools/Makefile
mcs/tools/linker/Descriptors/Mono.Posix.xml [deleted file]
mcs/tools/linker/Descriptors/System.Core.xml [deleted file]
mcs/tools/linker/Descriptors/System.Drawing.xml [deleted file]
mcs/tools/linker/Descriptors/System.Web.xml [deleted file]
mcs/tools/linker/Descriptors/System.xml [deleted file]
mcs/tools/linker/Descriptors/mscorlib.xml [deleted file]
mcs/tools/linker/Makefile
mcs/tools/linker/Tests/mscorlib/test-array.cs [new file with mode: 0644]
mcs/tools/linker/Tests/mscorlib/test-reflection.cs [new file with mode: 0644]

index 2d1d7438b9e0c77fef16851eded6cc7097a940ae..4748d08ef4c423d98ebe8f42ba930c531c482877 100644 (file)
@@ -49,7 +49,7 @@ net_4_5_dirs := \
        mono-symbolicate        \
        linker-analyzer
 
-build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr
+build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr linker
 net_4_5_SUBDIRS = gacutil
 net_4_5_PARALLEL_SUBDIRS = $(net_4_5_dirs)
 
diff --git a/mcs/tools/linker/Descriptors/Mono.Posix.xml b/mcs/tools/linker/Descriptors/Mono.Posix.xml
deleted file mode 100644 (file)
index 6f0ce66..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="Mono.Posix">
-               <type fullname="Mono.Posix.UnixEndPoint" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.Core.xml b/mcs/tools/linker/Descriptors/System.Core.xml
deleted file mode 100644 (file)
index e5a547f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System.Core">
-               <type fullname="System.Runtime.CompilerServices.CallSiteOps" preserve="methods" feature="dynamic" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.Drawing.xml b/mcs/tools/linker/Descriptors/System.Drawing.xml
deleted file mode 100644 (file)
index c1ae001..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System.Drawing">
-               <type fullname="System.Drawing.Imaging.BitmapData" preserve="fields" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.Web.xml b/mcs/tools/linker/Descriptors/System.Web.xml
deleted file mode 100644 (file)
index 7e98deb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System.Web">
-               <type fullname="System.Web.Util.ICalls" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.xml b/mcs/tools/linker/Descriptors/System.xml
deleted file mode 100644 (file)
index f70c020..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System">
-               <type fullname="System.Configuration.DefaultConfig" />
-               <type fullname="System.Diagnostics.DefaultTraceListener" />
-               <type fullname="System.Diagnostics.FileVersionInfo" />
-               <type fullname="System.Diagnostics.Process" />
-               <type fullname="System.Diagnostics.ProcessModule" />
-               <type fullname="System.IO.FAMWatcher" />
-               <type fullname="System.IO.FileSystemWatcher" />
-               <type fullname="System.IO.InotifyWatcher" />
-               <type fullname="System.Net.Dns" />
-               <type fullname="System.Net.SocketAddress" />
-               <type fullname="System.Net.Sockets.LingerOption" />
-               <type fullname="System.Net.Sockets.Socket" />
-               <type fullname="System.Net.Sockets.MulticastOption" preserve="fields" />
-               <type fullname="System.Net.Sockets.Socket/SocketAsyncResult" preserve="fields" />
-               <type fullname="System.Net.Sockets.SocketException" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/mscorlib.xml b/mcs/tools/linker/Descriptors/mscorlib.xml
deleted file mode 100644 (file)
index a92e407..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="mscorlib">
-
-               <type fullname="System.AppDomain" preserve="fields">
-                       <method name="DoDomainUnload" />
-                       <method name="DoTypeResolve" />
-                       <method name="DoAssemblyResolve" />
-                       <method name="DoAssemblyLoad" />
-                       <method name="DoDomainUnload" />
-                       <method name="InternalSetContext" />
-               </type>
-
-               <type fullname="System.AppDomainSetup" preserve="fields" />
-               <type fullname="System.AppDomainUnloadedException" />
-               <type fullname="System.ApplicationException" />
-               <type fullname="System.ArgIterator" />
-               <type fullname="System.ArgumentException" />
-               <type fullname="System.ArgumentNullException" />
-               <type fullname="System.ArgumentOutOfRangeException" />
-               <type fullname="System.ArithmeticException" />
-               <type fullname="System.Array">
-                       <method name="InternalArray__ICollection_get_Count" />
-                       <method name="InternalArray__ICollection_get_IsReadOnly" />
-                       <method name="InternalArray__IEnumerable_GetEnumerator" />
-                       <method name="InternalArray__ICollection_Clear" />
-                       <method name="InternalArray__ICollection_Add" />
-                       <method name="InternalArray__ICollection_Remove" />
-                       <method name="InternalArray__ICollection_Contains" />
-                       <method name="InternalArray__ICollection_CopyTo" />
-                       <method name="InternalArray__Insert" />
-                       <method name="InternalArray__RemoveAt" />
-                       <method name="InternalArray__IndexOf" />
-                       <method name="InternalArray__get_Item" />
-                       <method name="InternalArray__set_Item" />
-                       <method name="InternalArray__IReadOnlyList_get_Item" />
-                       <method name="InternalArray__IReadOnlyCollection_get_Count" />
-               </type>
-               <type fullname="System.ArrayTypeMismatchException" />
-               <type fullname="System.Attribute" />
-               <type fullname="System.BadImageFormatException" />
-               <type fullname="System.Boolean" preserve="fields" />
-               <type fullname="System.Byte" preserve="fields" />
-               <type fullname="System.CannotUnloadAppDomainException" />
-               <type fullname="System.Char" preserve="fields" />
-               <type fullname="System.Console" preserve="fields" />
-               <type fullname="System.ConsoleDriver" preserve="fields" />
-               <type fullname="System.ContextBoundObject" preserve="fields" />
-               <!-- <type fullname="System.Convert" /> -->
-               <type fullname="System.CurrentSystemTimeZone" />
-               <type fullname="System.DateTime" preserve="fields" />
-               <type fullname="System.DBNull" preserve="fields" />
-               <type fullname="System.Decimal" preserve="fields" />
-               <type fullname="System.Delegate" preserve="fields" />
-               <type fullname="System.Diagnostics.StackFrame" />
-               <type fullname="System.Diagnostics.StackTrace" />
-               <type fullname="System.DivideByZeroException" />
-               <!-- debugger-agent.c: create_event_list -->
-               <type fullname="System.Diagnostics.DebuggerNonUserCodeAttribute"/>
-               <type fullname="System.Diagnostics.DebuggerHiddenAttribute"/>
-               <type fullname="System.Diagnostics.DebuggerStepThroughAttribute"/>
-               
-               <type fullname="System.DllNotFoundException" />
-               <type fullname="System.Double" preserve="fields" />
-               <type fullname="System.Enum" preserve="fields">
-                       <method name="GetValues" />
-               </type>
-               <type fullname="System.EntryPointNotFoundException" />
-               <type fullname="System.Environment">
-                       <field name="mono_corlib_version" />
-                       <method name="get_StackTrace" />
-               </type>
-               <type fullname="System.Exception" />
-               <type fullname="System.ExecutionEngineException" />
-               <type fullname="System.FieldAccessException" />
-               <type fullname="System.FormatException" />
-               <type fullname="System.GC" />
-               <type fullname="System.IndexOutOfRangeException" />
-               <type fullname="System.Int16" preserve="fields" />
-               <type fullname="System.Int32" preserve="fields" />
-               <type fullname="System.Int64" preserve="fields" />
-               <type fullname="System.IntPtr" preserve="fields" />
-               <type fullname="System.InvalidCastException" />
-               <type fullname="System.InvalidOperationException" />
-               <type fullname="System.InvalidProgramException" />
-               <type fullname="System.MarshalByRefObject" preserve="fields" feature="remoting" />
-               <type fullname="System.MethodAccessException" />
-               <type fullname="System.Missing" preserve="fields" />
-               <type fullname="System.MissingFieldException" />
-               <type fullname="System.MissingMethodException" />
-               <type fullname="System.MonoAsyncCall" preserve="fields" />
-               <type fullname="System.MonoCustomAttrs" preserve="fields" />
-               <type fullname="System.MonoCustomAttrs/AttributeInfo" preserve="fields" />
-               <type fullname="System.MonoCQItem" preserve="all" />
-               <type fullname="System.MonoEnumInfo" preserve="fields" />
-               <type fullname="System.MonoListItem" preserve="fields" />
-               <type fullname="System.MonoType" preserve="fields" />
-               <type fullname="System.MulticastDelegate" preserve="fields" />
-               <type fullname="System.NotImplementedException" />
-               <type fullname="System.NotSupportedException" />
-               <type fullname="System.NullReferenceException" />
-               <type fullname="System.Nullable`1" preserve="fields">
-                       <method name="Box" />
-                       <method name="Unbox" />
-               </type>
-               <type fullname="System.Object" />
-               <type fullname="System.OutOfMemoryException" />
-               <type fullname="System.RuntimeArgumentHandle" preserve="fields" />
-               <type fullname="System.RuntimeFieldHandle" preserve="fields" />
-               <type fullname="System.RuntimeMethodHandle" preserve="fields" />
-               <type fullname="System.RuntimeTypeHandle" preserve="fields" />
-               <type fullname="System.SByte" preserve="fields" />
-               <type fullname="System.Single" preserve="fields" />
-               <type fullname="System.StackOverflowException" />
-               <type fullname="System.STAThreadAttribute" />
-               <type fullname="System.String" preserve="fields">
-                       <method name="CreateString" />
-                       <method name="InternalAllocateStr" />
-                       <method name="FastAllocateString" />
-                       <method name="memcpy" />
-                       <method name="memset" />
-                       <method name="bzero" />
-                       <method name="bzero_aligned_1" />
-                       <method name="bzero_aligned_2" />
-                       <method name="bzero_aligned_4" />
-                       <method name="bzero_aligned_8" />
-                       <method name="memcpy_aligned_1" />
-                       <method name="memcpy_aligned_2" />
-                       <method name="memcpy_aligned_4" />
-                       <method name="memcpy_aligned_8" />
-               </type>
-               <type fullname="System.SystemException" />
-               <type fullname="System.Type" preserve="fields">
-                       <method name="GetTypeFromHandle" />
-               </type>
-               <type fullname="System.TypeInitializationException" />
-               <type fullname="System.TypeLoadException" />
-               <type fullname="System.TypedReference" preserve="fields" />
-               <type fullname="System.UInt16" preserve="fields" />
-               <type fullname="System.UInt32" preserve="fields" />
-               <type fullname="System.UInt64" preserve="fields" />
-               <type fullname="System.UIntPtr" preserve="fields" />
-               <type fullname="System.UnhandledExceptionEventArgs" />
-               <type fullname="System.ValueType" preserve="fields" />
-               <type fullname="System.Variant" preserve="fields" feature="com">
-                       <method name="Clear" />
-               </type>
-               <type fullname="System.Version">
-                 <method signature="System.Void .ctor(System.Int32,System.Int32,System.Int32,System.Int32)" />
-               </type>
-               <type fullname="System.Void" />
-               <type fullname="System.__ComObject" feature="com" />
-
-               <type fullname="System.Collections.Generic.ICollection`1" />
-               <type fullname="System.Collections.Generic.IEnumerable`1" />
-               <type fullname="System.Collections.Generic.IEnumerator`1" />
-               <type fullname="System.Collections.Generic.IReadOnlyList`1" />
-               <type fullname="System.Collections.Generic.IReadOnlyCollection`1" />
-
-               <type fullname="System.Collections.Generic.IList`1" />
-               <type fullname="System.Collections.Generic.GenericEqualityComparer`1">
-                       <method name=".ctor" />
-               </type>
-               <type fullname="System.Collections.Generic.GenericComparer`1">
-                       <method name=".ctor" />
-               </type>
-
-               <type fullname="System.Globalization.DateTimeFormatInfo" preserve="fields" />
-               <type fullname="System.Globalization.CompareInfo" preserve="fields" />
-               <type fullname="System.Globalization.CultureInfo" preserve="fields">
-                       <method name="CreateCulture" />
-               </type>
-               <type fullname="System.Globalization.NumberFormatInfo" preserve="fields" />
-               <type fullname="System.Globalization.RegionInfo" preserve="fields" />
-               <type fullname="System.Globalization.SortKey" preserve="fields" />
-
-               <!--
-               <type fullname="System.IO.FileMode" />
-               <type fullname="System.IO.FileNotFoundException" />
-               <type fullname="System.IO.FileLoadException" />
-               <type fullname="System.IO.FileStreamAsyncResult" />
-               <type fullname="System.IO.IOException" />
-               <type fullname="System.IO.MonoIO" preserve="fields" />
-               <type fullname="System.IO.Path" />
-               <type fullname="System.IO.StreamReader" />
-               -->
-
-               <type fullname="System.Reflection.MonoAssembly">
-                       <method name=".ctor" />
-               </type>
-               <type fullname="System.Reflection.MonoModule">
-                       <method name=".ctor" />
-               </type>
-
-               <type fullname="System.Reflection.Assembly" preserve="fields">
-                       <method name="MonoDebugger_GetMethodToken" feature="sre" />
-                       <method name="GetNamespaces" feature="sre" />
-               </type>
-               <type fullname="System.Reflection.AssemblyName" preserve="fields" />
-               <type fullname="System.Reflection.ConstructorInfo" preserve="fields" />
-               <type fullname="System.Reflection.CustomAttributeData" preserve="fields">
-                 <method signature="System.Void .ctor(System.Reflection.ConstructorInfo,System.Reflection.Assembly,System.IntPtr,System.UInt32)" />
-               </type>
-               <type fullname="System.Reflection.CustomAttributeNamedArgument" preserve="fields" />
-               <type fullname="System.Reflection.CustomAttributeTypedArgument" preserve="fields" />
-               <type fullname="System.Reflection.EventInfo" preserve="fields">
-                       <method name="AddEventFrame" />
-                       <method name="StaticAddEventAdapterFrame" />
-               </type>
-               <type fullname="System.Reflection.ExceptionHandlingClause" preserve="fields" />
-               <type fullname="System.Reflection.FieldInfo" preserve="fields" />
-               <type fullname="System.Reflection.LocalVariableInfo" preserve="fields" />
-               <type fullname="System.Reflection.ManifestResourceInfo" preserve="fields" />
-               <type fullname="System.Reflection.MethodBase" preserve="fields" />
-               <type fullname="System.Reflection.MethodBody" preserve="fields" />
-               <type fullname="System.Reflection.MethodInfo" preserve="fields" />
-               <type fullname="System.Reflection.Module" preserve="fields">
-                       <method name="Mono_GetGuid" feature="sre" />
-               </type>
-               <type fullname="System.Reflection.MonoArrayMethod" preserve="fields" />
-               <type fullname="System.Reflection.MonoCMethod" preserve="fields" />
-               <type fullname="System.Reflection.MonoEvent" preserve="fields" />
-               <type fullname="System.Reflection.MonoEventInfo" preserve="fields" />
-               <type fullname="System.Reflection.MonoField" preserve="fields" />
-               <type fullname="System.Reflection.MonoGenericClass" preserve="fields" />
-               <type fullname="System.Reflection.MonoMethod" preserve="fields" />
-               <type fullname="System.Reflection.MonoMethodInfo" preserve="fields" />
-               <type fullname="System.Reflection.MonoPropertyInfo" preserve="fields" />
-               <type fullname="System.Reflection.MonoProperty" preserve="fields">
-                       <method name="GetterAdapterFrame" />
-                       <method name="StaticGetterAdapterFrame" />
-               </type>
-               <type fullname="System.Reflection.ParameterInfo" preserve="fields" />
-               <!-- reflection.c: ves_icall_get_parameter_info -->
-               <type fullname="System.Reflection.MonoParameterInfo" preserve="fields" />
-               
-               <type fullname="System.Reflection.PropertyInfo" preserve="fields" />
-               <type fullname="System.Reflection.ReflectionTypeLoadException" />
-               <type fullname="System.Reflection.TargetException" />
-               <type fullname="System.Reflection.TargetParameterCountException" />
-
-               <type fullname="System.Reflection.Emit.AssemblyBuilder" preserve="fields">
-                       <method name="AddPermissionRequests" />
-                       <method name="AddModule" />
-                       <method name="DefineIconResource" />
-                       <method name="AddTypeForwarder" />
-                       <method name="EmbedResourceFile" />
-               </type>
-               <type fullname="System.Reflection.Emit.ConstructorBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.CustomAttributeBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.DynamicMethod" preserve="fields" />
-               <type fullname="System.Reflection.Emit.EnumBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.EventBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.FieldBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.GenericTypeParameterBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ILExceptionBlock" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ILExceptionInfo" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ILGenerator" preserve="fields">
-                       <method name="Mono_GetCurrentOffset" />
-               </type>
-               <type fullname="System.Reflection.Emit.LocalBuilder" preserve="fields">
-                       <method name="Mono_GetLocalIndex" />
-               </type>
-               <type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ModuleBuilder" preserve="fields">
-                       <method name="Mono_GetGuid" />
-                       <method name="RuntimeResolve" />
-               </type>
-               <type fullname="System.Reflection.Emit.MonoResource" preserve="fields" />
-               <type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ParameterBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.PropertyBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.SignatureHelper" preserve="fields" />
-               <type fullname="System.Reflection.Emit.TypeBuilder" preserve="fields">
-                       <method name="SetCharSet" />
-               </type>
-               <type fullname="System.Reflection.Emit.UnmanagedMarshal" preserve="fields">
-                       <method name="DefineCustom" />
-                       <method name="DefineLPArrayInternal" />
-               </type>
-
-               <!--
-               <type fullname="System.Runtime.CompilerServices.CallConvCdecl" />
-               <type fullname="System.Runtime.CompilerServices.CallConvStdcall" />
-               <type fullname="System.Runtime.CompilerServices.CallConvFastcall" />
-               <type fullname="System.Runtime.CompilerServices.CallConvThiscall" />
-               -->
-
-               <type fullname="System.Runtime.CompilerServices.InternalsVisibleToAttribute" />
-               <type fullname="System.Runtime.CompilerServices.RuntimeWrappedException">
-                 <method signature="System.Void .ctor(System.Object)" />
-               </type>
-               <!-- <type fullname="System.Runtime.CompilerServices.RequiredAttributeAttribute" />
-               <type fullname="System.Runtime.CompilerServices.RuntimeHelpers" />
-               <type fullname="System.Runtime.CompilerServices.TypeForwardedToAttribute" /> -->
-
-               <!-- <type fullname="System.Runtime.InteropServices.DllImportAttribute" /> -->
-               <type fullname="System.Runtime.InteropServices.GCHandle" />
-               <!-- <type fullname="System.Runtime.InteropServices.GuidAttribute" /> -->
-               <type fullname="System.Runtime.InteropServices.HandleRef" />
-               <type fullname="System.Runtime.InteropServices.ICustomMarshaler" />
-               <!--<type fullname="System.Runtime.InteropServices.InterfaceTypeAttribute" /> -->
-               <type fullname="System.Runtime.InteropServices.Marshal" />
-               <!-- <type fullname="System.Runtime.InteropServices.MarshalDirectiveException" />
-               <type fullname="System.Runtime.InteropServices.SafeHandle" />
-               <type fullname="System.Runtime.InteropServices.StructLayoutAttribute" />
-               <type fullname="System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute" />-->
-
-               <!-- <type fullname="System.Runtime.Remoting.Activation.ActivationServices" /> -->
-               <type fullname="System.Runtime.Remoting.Contexts.Context" preserve="fields">
-                       <method name="get_NeedsContextSink" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Channels.CrossAppDomainSink" />
-               <type fullname="System.Runtime.Remoting.IRemotingTypeInfo">
-                       <method name="CanCastTo" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Messaging.AsyncResult" preserve="fields" />
-               <type fullname="System.Runtime.Remoting.Messaging.CallContext">
-                       <method name="SetCurrentCallContext" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Messaging.MonoMethodMessage" preserve="fields">
-                       <method name="InitMessage" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Proxies.RealProxy" preserve="fields">
-                       <method name="PrivateInvoke" />
-                       <method name="GetAppDomainTarget" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Proxies.TransparentProxy" preserve="fields">
-                       <method name="LoadRemoteFieldNew" />
-                       <method name="StoreRemoteField" />
-               </type>
-               <type fullname="System.Runtime.Remoting.RemotingServices">
-                       <method name="SerializeCallData" />
-                       <method name="DeserializeCallData" />
-                       <method name="SerializeExceptionData" />
-               </type>
-
-               <!--
-               <type fullname="System.Runtime.Serialization.ISerializable" />
-               <type fullname="System.Runtime.Serialization.SerializationException" />
-               <type fullname="System.Runtime.Serialization.SerializationInfo" />
-               <type fullname="System.Runtime.Serialization.StreamingContext" />
-               -->
-
-               <type fullname="System.Threading.ExecutionContext" />
-               <type fullname="System.Threading.Interlocked">
-                       <method name="CompareExchange" />
-                       <method name="Exchange" />
-               </type>
-               <type fullname="System.Threading.Monitor">
-                       <method name="Enter" />
-                       <method name="Exit" />
-                       <method name="enter_with_atomic_var" />
-               </type>
-
-               <!--
-               <type fullname="System.Threading.Mutex" />
-               <type fullname="System.Threading.NativeEventCalls" />
-               <type fullname="System.Threading.Semaphore" />
-               -->
-
-               <type fullname="System.Threading.SynchronisationLockException" />
-               <type fullname="System.Threading.Thread" preserve="fields">
-                       <method name="get_CurrentContext" />
-               </type>
-               <type fullname="System.Threading.InternalThread" preserve="fields" />
-               <type fullname="System.Threading.ThreadAbortException" />
-               <type fullname="System.Threading.ThreadInterruptedException" />
-               <!--<type fullname="System.Threading.ThreadPool" />-->
-               <type fullname="System.Threading.ThreadState" preserve="fields" />
-               <type fullname="System.Threading.ThreadStateException" />
-               <type fullname="System.Threading.WaitHandle" preserve="fields">
-                       <method name="set_Handle" />
-               </type>
-               <type fullname="System.Threading._ThreadPoolWaitCallback">
-                 <method name="PerformWaitCallback"/>
-               </type>
-
-               <type fullname="System.Text.StringBuilder" preserve="fields" />
-
-               <type fullname="System.Security.AllowPartiallyTrustedCallersAttribute" />
-               <type fullname="System.Security.Policy.Evidence" />
-               <!--
-               <type fullname="System.Security.Principal.WindowsIdentity" />
-               <type fullname="System.Security.Principal.WindowsImpersonationContext" />
-               <type fullname="System.Security.Principal.WindowsPrincipal" />
-               <type fullname="System.Security.RuntimeSecurityFrame" />
-               <type fullname="System.Security.SecurityCriticalAttribute" />
-               <type fullname="System.Security.SecurityException" />
-               -->
-               <type fullname="System.Security.SecurityManager" />
-               <!--
-               <type fullname="System.Security.SuppressUnmanagedCodeSecurityAttribute" />
-               <type fullname="System.Security.VerificationException" />
-               -->
-
-               <namespace fullname="System.Security.Cryptography" feature="crypto" />
-
-               <type fullname="Mono.Interop.ComInteropProxy" feature="com" />
-               <type fullname="Mono.Interop.IDispatch" feature="com" />
-               <type fullname="Mono.Interop.IUnknown" feature="com"/>
-
-                <!-- by convention (and see #34671) -->
-                <type fullname="Mono.Runtime" />
-
-               <type fullname="Mono.RuntimeStructs/HandleStackMark" />
-               <type fullname="Mono.RuntimeStructs/MonoError" />
-       </assembly>
-</linker>
index 3dd8398d2bcfad2456c4cf303d6cc2cd34666bf0..6823765ffd3cd3b726897f9a5ff9221b728d0663 100644 (file)
@@ -2,21 +2,43 @@ thisdir = tools/linker
 SUBDIRS =
 include ../../build/rules.make
 
-RESOURCES = \
-       Descriptors/mscorlib.xml        \
-       Descriptors/System.xml          \
-       Descriptors/System.Core.xml             \
-       Descriptors/System.Drawing.xml  \
-       Descriptors/System.Web.xml              \
-       Descriptors/Mono.Posix.xml              \
-
 PROGRAM = monolinker.exe
 
-$(PROGRAM): $(RESOURCES)
-
 LIB_REFS = System System.Core System.Xml Mono.Cecil
-LOCAL_MCS_FLAGS = $(RESOURCES:%=-resource:%)
 
-EXTRA_DISTFILES = $(RESOURCES)
+TEST_CASES = \
+       mscorlib/test-array.cs
+
+ifndef AOT_FRIENDLY_PROFILE
+TEST_CASES += \
+       mscorlib/test-reflection.cs
+endif
+
+TESTS_COMPILER = $(MCS) -nologo -noconfig -debug:portable -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
+
+check: compile-tests
+       $(MAKE) run-tests
+
+compile-tests: $(TEST_CASES)
+
+mscorlib/test-%.cs:
+       $(TESTS_COMPILER) Tests/$@ /out:Tests/$(@:.cs=.exe)
+
+run-tests: $(TEST_CASES:.cs=.exe)
+
+LINKER_OUTPUT := illink-output-$(PROFILE_DIRECTORY)
+PROFILE_PATH = $(topdir)/class/lib/$(PROFILE_DIRECTORY)
+LINKER = MONO_PATH=$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe -c link -out $(LINKER_OUTPUT) -b true -d $(PROFILE_PATH)
+TEST_EXEC = MONO_PATH=$(LINKER_OUTPUT) $(RUNTIME) $(RUNTIME_FLAGS) --debug -O=-aot
+
+.NOTPARALLEL:
+
+mscorlib/test-%.exe:
+       @rm -rf $(LINKER_OUTPUT)
+       @mkdir $(LINKER_OUTPUT)
+       @echo Testing $@
+       $(LINKER) -a Tests/$@
+       $(TEST_EXEC) $(LINKER_OUTPUT)/$(@F)
+       @rm -rf $(LINKER_OUTPUT)
 
 include ../../build/executable.make
diff --git a/mcs/tools/linker/Tests/mscorlib/test-array.cs b/mcs/tools/linker/Tests/mscorlib/test-array.cs
new file mode 100644 (file)
index 0000000..dc192b7
--- /dev/null
@@ -0,0 +1,10 @@
+using System.Collections;
+
+public class C
+{
+       public static int Main ()
+       {
+               IEnumerable ie = new int [3];
+               return 0;
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/linker/Tests/mscorlib/test-reflection.cs b/mcs/tools/linker/Tests/mscorlib/test-reflection.cs
new file mode 100644 (file)
index 0000000..b36b296
--- /dev/null
@@ -0,0 +1,35 @@
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Threading;
+using System.IO;
+
+public class C
+{
+       public static int Main ()
+       {
+               const string ASSEMBLY_NAME = "TypeBuilderTest";
+                       
+               AssemblyName assemblyName = new AssemblyName ();
+               assemblyName.Name = ASSEMBLY_NAME;
+
+               var assembly = Thread.GetDomain ().DefineDynamicAssembly (
+                               assemblyName, AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
+
+               var module = assembly.DefineDynamicModule ("module1");
+
+               TypeBuilder tb = module.DefineType ("bla", TypeAttributes.Public);
+               GenericTypeParameterBuilder [] typeParams = tb.DefineGenericParameters ("T");
+
+               ConstructorBuilder cb = tb.DefineDefaultConstructor (MethodAttributes.Public);
+
+               Type t = tb.MakeGenericType (typeof (int));
+               t.MakeArrayType ();
+
+               Type created = tb.CreateType ();
+
+               Type inst = created.MakeGenericType (typeof (object));          
+               return 0;
+       }
+}