-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Numerics;
+using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
{
s_success = true;
+#if !DEBUG
+ Console.WriteLine("****************************************************");
+ Console.WriteLine("* Size test *");
+ long fileSize = new System.IO.FileInfo(Environment.ProcessPath).Length;
+ Console.WriteLine($"* Size of the executable is {fileSize / 1024,7:n0} kB *");
+ Console.WriteLine("****************************************************");
+
+ const int Meg = 1024 * 1024;
+ const int HalfMeg = Meg / 2;
+ long lowerBound, upperBound;
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ lowerBound = 2 * Meg; // 2 MB
+ upperBound = 4 * Meg; // 4 MB
+ }
+ else
+ {
+ lowerBound = Meg + HalfMeg; // 1.5 MB
+ upperBound = 2 * Meg; // 2 MB
+ }
+
+ if (fileSize < lowerBound || fileSize > upperBound)
+ {
+ Console.WriteLine("BUG: File size is not in the expected range. Did a libraries change regress size of Hello World?");
+ return 1;
+ }
+
+ Console.WriteLine();
+#endif
+
// We expect the AOT compiler generated HW intrinsics with the following characteristics:
//
// * TRUE = IsSupported assumed to be true, no runtime check
<CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' != 'x64'">true</CLRTestTargetUnsupported>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);BASELINE_INTRINSICS</DefineConstants>
+ <StripSymbols>true</StripSymbols>
+
+ <!-- We should be able to delete once CI machines no longer use ancient LLVM -->
+ <ObjCopyName>objcopy</ObjCopyName>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' != 'x64'">true</CLRTestTargetUnsupported>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);NON_VEX_INTRINSICS</DefineConstants>
+ <StripSymbols>true</StripSymbols>
+
+ <!-- We should be able to delete once CI machines no longer use ancient LLVM -->
+ <ObjCopyName>objcopy</ObjCopyName>
</PropertyGroup>
<ItemGroup>
<CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' != 'x64'">true</CLRTestTargetUnsupported>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);VEX_INTRINSICS</DefineConstants>
+ <StripSymbols>true</StripSymbols>
+
+ <!-- We should be able to delete once CI machines no longer use ancient LLVM -->
+ <ObjCopyName>objcopy</ObjCopyName>
</PropertyGroup>
<ItemGroup>