Skip to content

Commit 4228ab0

Browse files
committed
[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
1 parent 3b1d455 commit 4228ab0

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@
55
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/refs2.s -o %t/refs2.o
66
# RUN: %lld -lSystem -dylib %t/defs.o -o %t/libdefs.dylib
77
# RUN: %lld -lSystem -dylib --icf=all %t/refs1.o %t/refs2.o %t/libdefs.dylib -o %t/out
8-
# RUN: llvm-objdump --macho --section-headers --bind %t/out | FileCheck %s \
9-
# RUN: --implicit-check-not __objc_classrefs
10-
11-
## Check that we only have 3 (unique) entries
12-
# CHECK: Sections:
13-
# CHECK-NEXT: Idx Name Size
14-
# CHECK: __objc_classrefs 00000018
15-
16-
## And only two binds
17-
# CHECK: Bind table:
18-
# CHECK-NEXT: segment section address type addend dylib symbol
19-
# CHECK-DAG: __DATA __objc_classrefs {{.*}} pointer 0 libdefs _OBJC_CLASS_$_Bar
20-
# CHECK-DAG: __DATA __objc_classrefs {{.*}} pointer 0 libdefs _OBJC_CLASS_$_Foo
8+
# RUN: llvm-otool -o %t/out | FileCheck %s
9+
10+
## Check that we only have 3 (unique) entries, of which two are bound at runtime
11+
## (i.e. they are entries that have a static value of 0x0).
12+
# CHECK: Contents of (__DATA,__objc_classrefs) section
13+
# CHECK-NEXT: 0000000000001008 0x0 _OBJC_CLASS_$_Foo
14+
# CHECK-NEXT: 0000000000001010 0x0 _OBJC_CLASS_$_Bar
15+
# CHECK-NEXT: 0000000000001018 0x1000 _OBJC_CLASS_$_Baz
16+
# CHECK-EMPTY:
2117

2218
#--- defs.s
2319
.globl _OBJC_CLASS_$_Foo, _OBJC_CLASS_$_Bar

0 commit comments

Comments
 (0)