Skip to content

Commit dee85bc

Browse files
committed
Merge two tests into one.
Signed-off-by: Peter Rong <PeterRong@meta.com>
1 parent f40e80c commit dee85bc

File tree

2 files changed

+14
-247
lines changed

2 files changed

+14
-247
lines changed

lld/test/MachO/objc-relative-method-lists-default-off-on-mac10.s

-244
This file was deleted.

lld/test/MachO/objc-relative-method-lists-simple.s

+14-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,19 @@
1717
# RUN: %no-lsystem-lld a64_rel_dylib.o -o a64_rel_dylib.dylib -map a64_rel_dylib.map -dylib -arch arm64 -no_objc_relative_method_lists
1818
# RUN: llvm-objdump --macho --objc-meta-data a64_rel_dylib.dylib | FileCheck %s --check-prefix=CHK_NO_REL
1919

20+
## Compile a64_rel_dylib.o with MacOS 10
21+
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos10 -o a64_rel_dylib.o a64_simple_class.s
2022

21-
CHK_REL: Contents of (__DATA_CONST,__objc_classlist) section
23+
## Test arm64 + relative method lists by explicitly adding `-objc_relative_method_lists`.
24+
# RUN: %lld a64_rel_dylib.o -o a64_rel_dylib.dylib -map a64_rel_dylib.map -dylib -arch arm64 -platform_version macOS 10.0 10.0 -objc_relative_method_lists
25+
# RUN: llvm-objdump --macho --objc-meta-data a64_rel_dylib.dylib | FileCheck %s --check-prefix=CHK_REL
26+
27+
## Test arm64 + no relative method lists by default.
28+
# RUN: %lld a64_rel_dylib.o -o a64_rel_dylib.dylib -map a64_rel_dylib.map -dylib -arch arm64 -platform_version macOS 10.0 10.0
29+
# RUN: llvm-objdump --macho --objc-meta-data a64_rel_dylib.dylib | FileCheck %s --check-prefix=CHK_NO_REL
30+
31+
32+
CHK_REL: Contents of (__DATA{{(_CONST)?}},__objc_classlist) section
2233
CHK_REL-NEXT: _OBJC_CLASS_$_MyClass
2334
CHK_REL: baseMethods
2435
CHK_REL-NEXT: entsize 12 (relative)
@@ -51,7 +62,7 @@ CHK_REL-NEXT: imp 0x{{[0-9a-f]*}} (0x{{[0-9a-f]*}}) +[MyClass class_method_0
5162

5263
CHK_NO_REL-NOT: (relative)
5364

54-
CHK_NO_REL: Contents of (__DATA_CONST,__objc_classlist) section
65+
CHK_NO_REL: Contents of (__DATA{{(_CONST)?}},__objc_classlist) section
5566
CHK_NO_REL-NEXT: _OBJC_CLASS_$_MyClass
5667

5768
CHK_NO_REL: baseMethods 0x{{[0-9a-f]*}} (struct method_list_t *)
@@ -125,7 +136,7 @@ CHK_NO_REL-NEXT: imp +[MyClass class_method_02]
125136
.include "objc-macros.s"
126137

127138
.section __TEXT,__text,regular,pure_instructions
128-
.build_version macos, 11, 0
139+
.build_version macos, 10, 0
129140

130141
.objc_selector_def "-[MyClass instance_method_00]"
131142
.objc_selector_def "-[MyClass instance_method_01]"

0 commit comments

Comments
 (0)