Skip to content

Commit 7c485bf

Browse files
author
Jessica Paquette
committed
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
1 parent d7fc7bf commit 7c485bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lnt/tests/test_suite.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
fail;*;*;*;
8181
{%- else -%}
8282
pass;{{ test.metrics.compile_time if test.metrics }};\
83-
{{ test.metrics['size..text'] if test.metrics }};\
83+
{{ test.metrics.get('size..text') or test.metrics.get('size.__text') if test.metrics }};\
8484
{{ test.metrics.hash if test.metrics }};
8585
{%- endif -%}
8686
{%- if test.code == "FAIL" or test.code == "NOEXE" -%}
@@ -714,6 +714,8 @@ def _parse_lit_output(self, path, data, cmake_vars, only_test=False):
714714
'hash': 'hash',
715715
'link_time': 'compile',
716716
'size..text': 'code_size',
717+
# On Darwin, the section name is reported as `__text`.
718+
'size.__text': 'code_size',
717719
'mem_bytes': 'mem',
718720
'link_mem_bytes': 'mem'
719721
}
@@ -724,6 +726,8 @@ def _parse_lit_output(self, path, data, cmake_vars, only_test=False):
724726
'hash': str,
725727
'link_time': float,
726728
'size..text': float,
729+
# On Darwin, the section name is reported as `__text`.
730+
'size.__text': float,
727731
'mem_bytes': float,
728732
'link_mem_bytes': float
729733
}

0 commit comments

Comments
 (0)