173
|
1 # REQUIRES: x86
|
|
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
|
|
3 # RUN: lld -flavor darwinnew -o %t %t.o
|
|
4 # RUN: llvm-readobj -symbols %t | FileCheck %s
|
|
5
|
|
6 # CHECK: Symbols [
|
|
7 # CHECK-NEXT: Symbol {
|
|
8 # CHECK-NEXT: Name: _main
|
|
9 # CHECK-NEXT: Extern
|
|
10 # CHECK-NEXT: Type: Section (0xE)
|
|
11 # CHECK-NEXT: Section: __text (0x1)
|
|
12 # CHECK-NEXT: RefType:
|
|
13 # CHECK-NEXT: Flags [ (0x0)
|
|
14 # CHECK-NEXT: ]
|
|
15 # CHECK-NEXT: Value:
|
|
16 # CHECK-NEXT: }
|
|
17 # CHECK-NEXT: Symbol {
|
|
18 # CHECK-NEXT: Name: bar
|
|
19 # CHECK-NEXT: Extern
|
|
20 # CHECK-NEXT: Type: Section (0xE)
|
|
21 # CHECK-NEXT: Section: __text (0x1)
|
|
22 # CHECK-NEXT: RefType:
|
|
23 # CHECK-NEXT: Flags [ (0x0)
|
|
24 # CHECK-NEXT: ]
|
|
25 # CHECK-NEXT: Value:
|
|
26 # CHECK-NEXT: }
|
|
27 # CHECK-NEXT: Symbol {
|
|
28 # CHECK-NEXT: Name: foo
|
|
29 # CHECK-NEXT: Extern
|
|
30 # CHECK-NEXT: Type: Section (0xE)
|
|
31 # CHECK-NEXT: Section: __data
|
|
32 # CHECK-NEXT: RefType:
|
|
33 # CHECK-NEXT: Flags [ (0x0)
|
|
34 # CHECK-NEXT: ]
|
|
35 # CHECK-NEXT: Value:
|
|
36 # CHECK-NEXT: }
|
|
37 # CHECK-NEXT: ]
|
|
38
|
|
39 .data
|
|
40 .global foo
|
|
41 foo:
|
|
42 .asciz "Hello world!\n"
|
|
43
|
|
44 .text
|
|
45 .global bar
|
|
46 .global _main
|
|
47
|
|
48 _main:
|
|
49 mov $0, %rax
|
|
50 ret
|
|
51
|
|
52 bar:
|
|
53 mov $2, %rax
|
|
54 ret
|