From f7547558c9f1b27d2fbc282ddd78e051b238db17 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Thu, 3 Mar 2022 18:58:08 -0500 Subject: [PATCH] [lld-macho][nfc] Avoid using absolute addresses in cgprofile-icf.s If we fix https://github.com/llvm/llvm-project/issues/54184, the `dyld_stub_binder` symbol will get included in every output dylib. This would cause the addresses of the other symbols to shift, breaking the test as it currently stands. Let's make the test more flexible. Reviewed By: lgrey Differential Revision: https://reviews.llvm.org/D120940 --- lld/test/MachO/cgprofile-icf.s | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lld/test/MachO/cgprofile-icf.s b/lld/test/MachO/cgprofile-icf.s index 3d34b93..f9034ee 100644 --- a/lld/test/MachO/cgprofile-icf.s +++ b/lld/test/MachO/cgprofile-icf.s @@ -34,13 +34,12 @@ A: .subsections_via_symbols -# CHECK: 0000000100000290 T A -# CHECK-NEXT: 0000000100000298 T C -# CHECK-NEXT: 0000000100000298 T D -# CHECK-NEXT: 00000001000002a0 T B - -# NOICF: 0000000100000290 T A -# NOICF-NEXT: 0000000100000298 T B -# NOICF-NEXT: 00000001000002a0 T C -# NOICF-NEXT: 00000001000002a8 T D - +# CHECK: [[#%.16x,A:]] T A +# CHECK-NEXT: [[#%.16x,A+8]] T C +# CHECK-NEXT: [[#%.16x,A+8]] T D +# CHECK-NEXT: [[#%.16x,A+16]] T B + +# NOICF: [[#%.16x,A:]] T A +# NOICF-NEXT: [[#%.16x,A+8]] T B +# NOICF-NEXT: [[#%.16x,A+16]] T C +# NOICF-NEXT: [[#%.16x,A+24]] T D -- 2.7.4