Restore code size tracking support in Darwin
D109576 broke code size metric collection on Darwin platforms.
This patch restores support in Darwin.
The reason support was broken is that `llvm-size` outputs text section size with
leading underscores, while on other platforms, it leads with periods.
https://reviews.llvm.org/D146257
diff --git a/lnt/tests/test_suite.py b/lnt/tests/test_suite.py
index 7f96ec3..46aa66f 100644
--- a/lnt/tests/test_suite.py
+++ b/lnt/tests/test_suite.py
@@ -80,7 +80,7 @@
fail;*;*;*;
{%- else -%}
pass;{{ test.metrics.compile_time if test.metrics }};\
-{{ test.metrics['size..text'] if test.metrics }};\
+{{ test.metrics.get('size..text') or test.metrics.get('size.__text') if test.metrics }};\
{{ test.metrics.hash if test.metrics }};
{%- endif -%}
{%- if test.code == "FAIL" or test.code == "NOEXE" -%}
@@ -714,6 +714,8 @@
'hash': 'hash',
'link_time': 'compile',
'size..text': 'code_size',
+ # On Darwin, the section name is reported as `__text`.
+ 'size.__text': 'code_size',
'mem_bytes': 'mem',
'link_mem_bytes': 'mem'
}
@@ -724,6 +726,8 @@
'hash': str,
'link_time': float,
'size..text': float,
+ # On Darwin, the section name is reported as `__text`.
+ 'size.__text': float,
'mem_bytes': float,
'link_mem_bytes': float
}