2 # RUN: rm -rf %t; split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/qux.s -o %t/qux.o
5 # RUN: %lld -dylib %t/test.o %t/qux.o -o %t/test
6 # RUN: llvm-objdump --macho --section="__TEXT,__literals" --section="__DATA,ptrs" --syms %t/test | FileCheck %s
7 # RUN: llvm-readobj --section-headers %t/test | FileCheck %s --check-prefix=HEADER
9 # RUN: %lld -dylib -no_deduplicate %t/test.o %t/qux.o -o %t/test
10 # RUN: llvm-objdump --macho --section="__TEXT,__literals" --section="__DATA,ptrs" --syms %t/test | FileCheck %s
11 # RUN: llvm-readobj --section-headers %t/test | FileCheck %s --check-prefix=HEADER
13 # CHECK: Contents of (__TEXT,__literals) section
14 # CHECK-NEXT: [[#%.16x,DEADBEEF16:]] ef be ad de ef be ad de ef be ad de ef be ad de
15 # CHECK-NEXT: [[#%.16x,FEEDFACE16:]] ce fa ed fe ce fa ed fe ce fa ed fe ce fa ed fe
16 # CHECK-NEXT: [[#%.16x,DEADBEEF8:]] ef be ad de ef be ad de ce fa ed fe ce fa ed fe
17 # CHECK-NEXT: [[#%.16x,DEADBEEF4:]] ef be ad de ce fa ed fe
18 # CHECK-NEXT: Contents of (__DATA,ptrs) section
19 # CHECK-NEXT: 0000000000001000 0x[[#%x,DEADBEEF16]]
20 # CHECK-NEXT: 0000000000001008 0x[[#%x,DEADBEEF16]]
21 # CHECK-NEXT: 0000000000001010 0x[[#%x,FEEDFACE16]]
22 # CHECK-NEXT: 0000000000001018 0x[[#%x,DEADBEEF16]]
23 # CHECK-NEXT: 0000000000001020 0x[[#%x,DEADBEEF8]]
24 # CHECK-NEXT: 0000000000001028 0x[[#%x,DEADBEEF8]]
25 # CHECK-NEXT: 0000000000001030 0x[[#%x,DEADBEEF8 + 8]]
26 # CHECK-NEXT: 0000000000001038 0x[[#%x,DEADBEEF8]]
27 # CHECK-NEXT: 0000000000001040 0x[[#%x,DEADBEEF4]]
28 # CHECK-NEXT: 0000000000001048 0x[[#%x,DEADBEEF4]]
29 # CHECK-NEXT: 0000000000001050 0x[[#%x,DEADBEEF4 + 4]]
30 # CHECK-NEXT: 0000000000001058 0x[[#%x,DEADBEEF4]]
32 ## Make sure the symbol addresses are correct too.
33 # CHECK: SYMBOL TABLE:
34 # CHECK-DAG: [[#DEADBEEF16]] g O __TEXT,__literals _qux16
35 # CHECK-DAG: [[#DEADBEEF8]] g O __TEXT,__literals _qux8
36 # CHECK-DAG: [[#DEADBEEF4]] g O __TEXT,__literals _qux4
38 ## Make sure we set the right alignment and flags.
39 # HEADER: Name: __literals
40 # HEADER-NEXT: Segment: __TEXT
41 # HEADER-NEXT: Address:
43 # HEADER-NEXT: Offset:
44 # HEADER-NEXT: Alignment: 4
45 # HEADER-NEXT: RelocationOffset:
46 # HEADER-NEXT: RelocationCount: 0
47 # HEADER-NEXT: Type: Regular
48 # HEADER-NEXT: Attributes [ (0x0)
50 # HEADER-NEXT: Reserved1: 0x0
51 # HEADER-NEXT: Reserved2: 0x0
52 # HEADER-NEXT: Reserved3: 0x0
66 .quad 0xdeadbeefdeadbeef
68 .quad 0xdeadbeefdeadbeef
70 .quad 0xfeedfacefeedface
74 .quad 0xdeadbeefdeadbeef
75 .quad 0xdeadbeefdeadbeef
77 .quad 0xdeadbeefdeadbeef
78 .quad 0xdeadbeefdeadbeef
80 .quad 0xfeedfacefeedface
81 .quad 0xfeedfacefeedface
83 .section __DATA,ptrs,literal_pointers
100 .globl _qux4, _qux8, _qux16
109 .quad 0xdeadbeefdeadbeef
113 .quad 0xdeadbeefdeadbeef
114 .quad 0xdeadbeefdeadbeef