[lld] f754755 - [lld-macho][nfc] Avoid using absolute addresses in cgprofile-icf.s

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 16:00:49 PST 2022


Author: Jez Ng
Date: 2022-03-03T19:00:28-05:00
New Revision: f7547558c9f1b27d2fbc282ddd78e051b238db17

URL: https://github.com/llvm/llvm-project/commit/f7547558c9f1b27d2fbc282ddd78e051b238db17
DIFF: https://github.com/llvm/llvm-project/commit/f7547558c9f1b27d2fbc282ddd78e051b238db17.diff

LOG: [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

Added: 
    

Modified: 
    lld/test/MachO/cgprofile-icf.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/cgprofile-icf.s b/lld/test/MachO/cgprofile-icf.s
index 3d34b9336790a..f9034ee32103a 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


        


More information about the llvm-commits mailing list