Skip to content

Commit e6dd087

Browse files
committed
Add regression test
1 parent 17281eb commit e6dd087

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4+
<OutputType>Exe</OutputType>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<Compile Include="repro.cs" />
8+
</ItemGroup>
9+
</Project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
3+
/* Regression test for https://github.com/dotnet/runtime/issues/78638
4+
* and https://github.com/dotnet/runtime/issues/82187 ensure AOT
5+
* cross-compiler and AOT runtime use the same name hashing for names
6+
* that include UTF-8 continuation bytes.
7+
*/
8+
9+
[MySpecial(typeof(MeineTüre))]
10+
public class Program
11+
{
12+
public static int Main()
13+
{
14+
var attr = (MySpecialAttribute)Attribute.GetCustomAttribute(typeof (Program), typeof(MySpecialAttribute), false);
15+
if (attr == null)
16+
return 101;
17+
if (attr.Type == null)
18+
return 102;
19+
if (attr.Type.FullName != "MeineTüre")
20+
return 103;
21+
return 100;
22+
}
23+
}
24+
25+
public class MySpecialAttribute : Attribute
26+
{
27+
public Type Type {get; private set; }
28+
public MySpecialAttribute(Type t) { Type = t; }
29+
}
30+
31+
public class MeineTüre {}

0 commit comments

Comments
 (0)