3 # RUN: rm -rf %t; split-file %s %t
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o
6 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/bar.s -o %t/bar.o
7 # RUN: %lld -lSystem %t/foo.o %t/bar.o -o %t/main.exe
8 # RUN: llvm-otool -l %t/main.exe > %t/objdump
9 # RUN: llvm-objdump --macho --data-in-code %t/main.exe >> %t/objdump
10 # RUN: FileCheck %s < %t/objdump
12 # CHECK-LABEL: sectname __text
13 # CHECK-NEXT: segname __TEXT
16 # CHECK-NEXT: offset [[#%,TEXT:]]
18 # CHECK-LABEL: cmd LC_DATA_IN_CODE
19 # CHECK-NEXT: cmdsize 16
21 # CHECK-NEXT: datasize 16
23 # CHECK-LABEL: Data in code table (2 entries)
24 # CHECK-NEXT: offset length kind
25 # CHECK-NEXT: [[#%x,TEXT + 28]] 24 JUMP_TABLE32
26 # CHECK-NEXT: [[#%x,TEXT + 68]] 12 JUMP_TABLE32
28 # RUN: %lld -lSystem %t/foo.o %t/bar.o -no_data_in_code_info -o %t/main.exe
29 # RUN: llvm-otool -l %t/main.exe | FileCheck --check-prefix=OMIT %s
31 # OMIT-NOT: LC_DATA_IN_CODE
33 # RUN: %lld -lSystem %t/foo.o %t/bar.o -no_data_in_code_info -data_in_code_info -o %t/main.exe
34 # RUN: llvm-otool -l %t/main.exe > %t/objdump
35 # RUN: llvm-objdump --macho --data-in-code %t/main.exe >> %t/objdump
36 # RUN: FileCheck %s < %t/objdump