Skip to content

Commit 0580a0c

Browse files
authored
Only count DwarfDump warnings produced by managed code (#112813)
1 parent 58209bb commit 0580a0c

File tree

1 file changed

+22
-8
lines changed
  • src/tests/nativeaot/SmokeTests/DwarfDump

1 file changed

+22
-8
lines changed

src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,37 @@ public static int Main(string[] args)
5050
});
5151

5252
// Just count the number of warnings and errors. There are so many right now that it's not worth enumerating the list
53-
#if DEBUG
54-
const int MinWarnings = 2000;
55-
const int MaxWarnings = 4000;
56-
#else
57-
const int MinWarnings = 3000;
58-
const int MaxWarnings = 5000;
59-
#endif
53+
const int MinWarnings = 15;
54+
const int MaxWarnings = 150;
6055
int count = 0;
56+
bool foundIlCpp = false;
57+
bool insideIlCpp = false;
6158
string line;
6259
while ((line = proc.StandardOutput.ReadLine()) != null)
6360
{
64-
if (line.Contains("warning:") || line.Contains("error:"))
61+
if (line.StartsWith("Verifying unit:"))
62+
{
63+
if (line.EndsWith("\"il.cpp\""))
64+
{
65+
foundIlCpp = true;
66+
insideIlCpp = true;
67+
}
68+
else
69+
{
70+
insideIlCpp = false;
71+
}
72+
}
73+
if ((line.Contains("warning:") || line.Contains("error:")) && insideIlCpp)
6574
{
6675
count++;
6776
}
6877
}
6978

79+
if (!foundIlCpp)
80+
{
81+
Console.Error.WriteLine($"llvm-dwarfdump failed. Cound not find unit named \"il.cpp\".");
82+
return 10;
83+
}
7084

7185
if (count == 0)
7286
{

0 commit comments

Comments
 (0)