[PATCH] D141024: [lld-macho][test] Simplify classrefs test

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 19:53:37 PST 2023


int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added projects: lld-macho, All.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I wasn't previously aware of the `--objc-meta-data` flag; that makes
llvm-objdump's output a lot easier to parse.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141024

Files:
  lld/test/MachO/objc-classrefs-dedup.s


Index: lld/test/MachO/objc-classrefs-dedup.s
===================================================================
--- lld/test/MachO/objc-classrefs-dedup.s
+++ 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-objdump --macho --objc-meta-data %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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141024.486452.patch
Type: text/x-patch
Size: 1583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230105/bc7379f8/attachment.bin>


More information about the llvm-commits mailing list