[lld] 4228ab0 - [lld-macho][test] Simplify classrefs test
Jez Ng via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 10:30:44 PST 2023
Author: Jez Ng
Date: 2023-01-05T13:30:10-05:00
New Revision: 4228ab009fa793c843620886b698696ee519fc97
URL: https://github.com/llvm/llvm-project/commit/4228ab009fa793c843620886b698696ee519fc97
DIFF: https://github.com/llvm/llvm-project/commit/4228ab009fa793c843620886b698696ee519fc97.diff
LOG: [lld-macho][test] Simplify classrefs test
I wasn't previously aware of the `llvm-otool -o` flag; that gives us
output that's a lot easier to parse.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D141024
Added:
Modified:
lld/test/MachO/objc-classrefs-dedup.s
Removed:
################################################################################
diff --git a/lld/test/MachO/objc-classrefs-dedup.s b/lld/test/MachO/objc-classrefs-dedup.s
index dcb6bd6b75a55..1df482d4d890a 100644
--- a/lld/test/MachO/objc-classrefs-dedup.s
+++ b/lld/test/MachO/objc-classrefs-dedup.s
@@ -5,19 +5,15 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/refs2.s -o %t/refs2.o
# RUN: %lld -lSystem -dylib %t/defs.o -o %t/libdefs.dylib
# RUN: %lld -lSystem -dylib --icf=all %t/refs1.o %t/refs2.o %t/libdefs.dylib -o %t/out
-# RUN: llvm-objdump --macho --section-headers --bind %t/out | FileCheck %s \
-# RUN: --implicit-check-not __objc_classrefs
-
-## Check that we only have 3 (unique) entries
-# CHECK: Sections:
-# CHECK-NEXT: Idx Name Size
-# CHECK: __objc_classrefs 00000018
-
-## And only two binds
-# CHECK: Bind table:
-# CHECK-NEXT: segment section address type addend dylib symbol
-# CHECK-DAG: __DATA __objc_classrefs {{.*}} pointer 0 libdefs _OBJC_CLASS_$_Bar
-# CHECK-DAG: __DATA __objc_classrefs {{.*}} pointer 0 libdefs _OBJC_CLASS_$_Foo
+# RUN: llvm-otool -o %t/out | FileCheck %s
+
+## Check that we only have 3 (unique) entries, of which two are bound at runtime
+## (i.e. they are entries that have a static value of 0x0).
+# CHECK: Contents of (__DATA,__objc_classrefs) section
+# CHECK-NEXT: 0000000000001008 0x0 _OBJC_CLASS_$_Foo
+# CHECK-NEXT: 0000000000001010 0x0 _OBJC_CLASS_$_Bar
+# CHECK-NEXT: 0000000000001018 0x1000 _OBJC_CLASS_$_Baz
+# CHECK-EMPTY:
#--- defs.s
.globl _OBJC_CLASS_$_Foo, _OBJC_CLASS_$_Bar
More information about the llvm-commits
mailing list