1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -t | FileCheck %s
2
3foo:
4bar = foo
5
6        .globl	foo2
7foo2 = bar2
8
9foo3:
10	.globl	bar3
11bar3 = foo3
12
13
14// Test that bar4  and bar 5 are also functions and have the same value as foo4.
15	.byte 0
16	.type	foo4,@function
17foo4:
18bar4 = foo4
19bar5 = bar4
20
21        .long foo2
22
23// Test that bar6 is a function that doesn't have the same value as foo4.
24bar6 = bar5
25bar6:
26
27// Test that indirect local aliases do not appear as symbols.
28.data
29.Llocal:
30
31.text
32leaq .Llocal1(%rip), %rdi
33.Llocal1 = .Llocal2
34.Llocal2 = .Llocal
35
36// CHECK:      Symbols [
37// CHECK-NEXT:   Symbol {
38// CHECK-NEXT:     Name:  (0)
39// CHECK-NEXT:     Value: 0x0
40// CHECK-NEXT:     Size: 0
41// CHECK-NEXT:     Binding: Local (0x0)
42// CHECK-NEXT:     Type: None (0x0)
43// CHECK-NEXT:     Other: 0
44// CHECK-NEXT:     Section: Undefined (0x0)
45// CHECK-NEXT:   }
46// CHECK-NEXT:   Symbol {
47// CHECK-NEXT:     Name: bar
48// CHECK-NEXT:     Value: 0x0
49// CHECK-NEXT:     Size: 0
50// CHECK-NEXT:     Binding: Local
51// CHECK-NEXT:     Type: None
52// CHECK-NEXT:     Other: 0
53// CHECK-NEXT:     Section: .text
54// CHECK-NEXT:   }
55// CHECK-NEXT:   Symbol {
56// CHECK-NEXT:     Name: bar4
57// CHECK-NEXT:     Value: 0x1
58// CHECK-NEXT:     Size: 0
59// CHECK-NEXT:     Binding: Local
60// CHECK-NEXT:     Type: Function
61// CHECK-NEXT:     Other: 0
62// CHECK-NEXT:     Section: .text
63// CHECK-NEXT:   }
64// CHECK-NEXT:   Symbol {
65// CHECK-NEXT:     Name: bar5
66// CHECK-NEXT:     Value: 0x1
67// CHECK-NEXT:     Size: 0
68// CHECK-NEXT:     Binding: Local
69// CHECK-NEXT:     Type: Function
70// CHECK-NEXT:     Other: 0
71// CHECK-NEXT:     Section: .text
72// CHECK-NEXT:   }
73// CHECK-NEXT:   Symbol {
74// CHECK-NEXT:     Name: bar6
75// CHECK-NEXT:     Value: 0x5
76// CHECK-NEXT:     Size: 0
77// CHECK-NEXT:     Binding: Local
78// CHECK-NEXT:     Type: None
79// CHECK-NEXT:     Other: 0
80// CHECK-NEXT:     Section: .text
81// CHECK-NEXT:   }
82// CHECK-NEXT:   Symbol {
83// CHECK-NEXT:     Name: foo
84// CHECK-NEXT:     Value: 0x0
85// CHECK-NEXT:     Size: 0
86// CHECK-NEXT:     Binding: Local
87// CHECK-NEXT:     Type: None
88// CHECK-NEXT:     Other: 0
89// CHECK-NEXT:     Section: .text
90// CHECK-NEXT:   }
91// CHECK-NEXT:   Symbol {
92// CHECK-NEXT:     Name: foo3
93// CHECK-NEXT:     Value: 0x0
94// CHECK-NEXT:     Size: 0
95// CHECK-NEXT:     Binding: Local
96// CHECK-NEXT:     Type: None
97// CHECK-NEXT:     Other: 0
98// CHECK-NEXT:     Section: .text
99// CHECK-NEXT:   }
100// CHECK-NEXT:   Symbol {
101// CHECK-NEXT:     Name: foo4
102// CHECK-NEXT:     Value: 0x1
103// CHECK-NEXT:     Size: 0
104// CHECK-NEXT:     Binding: Local
105// CHECK-NEXT:     Type: Function
106// CHECK-NEXT:     Other: 0
107// CHECK-NEXT:     Section: .text
108// CHECK-NEXT:   }
109// CHECK-NEXT:   Symbol {
110// CHECK-NEXT:     Name: .text (0)
111// CHECK-NOT: Symbol {
112// CHECK:        }
113// CHECK-NEXT:   Symbol {
114// CHECK-NEXT:     Name: .data (0)
115// CHECK-NOT: Symbol {
116// CHECK:        }
117// CHECK-NEXT:   Symbol {
118// CHECK-NEXT:     Name: .bss (0)
119// CHECK-NOT: Symbol {
120// CHECK:        }
121// CHECK-NEXT:   Symbol {
122// CHECK-NEXT:     Name: bar3
123// CHECK-NEXT:     Value: 0x0
124// CHECK-NEXT:     Size: 0
125// CHECK-NEXT:     Binding: Global
126// CHECK-NEXT:     Type: None
127// CHECK-NEXT:     Other: 0
128// CHECK-NEXT:     Section: .text
129// CHECK-NEXT:   }
130// CHECK-NEXT:   Symbol {
131// CHECK-NEXT:     Name: bar2
132// CHECK-NEXT:     Value: 0x0
133// CHECK-NEXT:     Size: 0
134// CHECK-NEXT:     Binding: Global
135// CHECK-NEXT:     Type: None
136// CHECK-NEXT:     Other: 0
137// CHECK-NEXT:     Section: Undefined (0x0)
138// CHECK-NEXT:   }
139// CHECK-NEXT: ]
140