forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbdc984
commit 682a3c0
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/tests/FunctionalTests/iOS/Device/IsDynamicCodeSupported/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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.Threading; | ||
using System.Threading.Tasks; | ||
using System.Runtime.InteropServices; | ||
|
||
public static class Program | ||
{ | ||
[DllImport("__Internal")] | ||
public static extern void mono_ios_set_summary (string value); | ||
|
||
public static async Task<int> Main(string[] args) | ||
{ | ||
mono_ios_set_summary($"Starting functional test"); | ||
Console.WriteLine("Done!"); | ||
await Task.Delay(5000); | ||
|
||
var runtimeFeatureType = typeof(object).Assembly.GetType("System.Runtime.CompilerServices.RuntimeFeature"); | ||
var isDynamicCodeSupportedGetter = runtimeFeatureType?.GetMethod("get_IsDynamicCodeSupported"); | ||
|
||
// get_IsDynamicCodeSupported should have been trimmed-out (substituted by false) | ||
return isDynamicCodeSupportedGetter is null ? 42 : -1; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...onalTests/iOS/Device/IsDynamicCodeSupported/iOS.Device.IsDynamicCodeSupported.Test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" TreatAsLocalProperty="MonoForceInterpreter"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<MonoForceInterpreter>false</MonoForceInterpreter> | ||
<RunAOTCompilation>true</RunAOTCompilation> | ||
<TestRuntime>true</TestRuntime> | ||
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework> | ||
<TargetOS Condition="'$(TargetOS)' == ''">ios</TargetOS> | ||
<MainLibraryFileName>iOS.Device.IsDynamicCodeSupported.Test.dll</MainLibraryFileName> | ||
<IncludesTestRunner>false</IncludesTestRunner> | ||
<ExpectedExitCode>42</ExpectedExitCode> | ||
<EnableAggressiveTrimming Condition="'$(EnableAggressiveTrimming)' == ''">true</EnableAggressiveTrimming> | ||
<MonoEnableLLVM>true</MonoEnableLLVM> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="Program.cs" /> | ||
</ItemGroup> | ||
</Project> |