[lld-macho][nfc] Avoid using absolute addresses in cgprofile-icf.s
authorJez Ng <jezng@fb.com>
Thu, 3 Mar 2022 23:58:08 +0000 (18:58 -0500)
committerJez Ng <jezng@fb.com>
Fri, 4 Mar 2022 00:00:28 +0000 (19:00 -0500)
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

index 3d34b93..f9034ee 100644 (file)
@@ -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