[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / MC / COFF / weak-alias-labels.s
blobf53389d332fe39393db6ff5d19a824eb3f40af53
1 // RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj --symbols - | FileCheck %s
2 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj --symbols - | FileCheck %s
4 // When making weak references to labels/procedures, we reference them directly
5 // if they have global symbols; otherwise, we need to create a global symbol for
6 // the reference to resolve to.
8 .text
10 .globl proc1
11 proc1:
12 ret
14 proc2:
15 ret
16 // CHECK: Symbol {
17 // CHECK: Name: proc2
18 // CHECK-NEXT: Value: [[PROC2_VALUE:[0-9]+]]
19 // CHECK-NEXT: Section: [[PROC2_SECTION:.*]]
20 // CHECK-NEXT: BaseType: Null
21 // CHECK-NEXT: ComplexType: Null
22 // CHECK-NEXT: StorageClass: Static
23 // CHECK-NEXT: AuxSymbolCount: 0
24 // CHECK-NEXT: }
26 .weak t1
27 t1 = proc1
29 // CHECK: Symbol {
30 // CHECK: Name: t1
31 // CHECK-NEXT: Value: 0
32 // CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED
33 // CHECK-NEXT: BaseType: Null
34 // CHECK-NEXT: ComplexType: Null
35 // CHECK-NEXT: StorageClass: WeakExternal
36 // CHECK-NEXT: AuxSymbolCount: 1
37 // CHECK-NEXT: AuxWeakExternal {
38 // CHECK-NEXT: Linked: proc1
39 // CHECK-NEXT: Search: Alias
40 // CHECK-NEXT: }
41 // CHECK-NEXT: }
43 .weak t2
44 t2 = proc2
46 // CHECK: Symbol {
47 // CHECK: Name: t2
48 // CHECK-NEXT: Value: 0
49 // CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED
50 // CHECK-NEXT: BaseType: Null
51 // CHECK-NEXT: ComplexType: Null
52 // CHECK-NEXT: StorageClass: WeakExternal
53 // CHECK-NEXT: AuxSymbolCount: 1
54 // CHECK-NEXT: AuxWeakExternal {
55 // CHECK-NEXT: Linked: .weak.t2.default
56 // CHECK-NEXT: Search: Alias
57 // CHECK-NEXT: }
58 // CHECK-NEXT: }
59 // CHECK: Symbol {
60 // CHECK: Name: .weak.t2.default
61 // CHECK-NEXT: Value: [[PROC2_VALUE]]
62 // CHECK-NEXT: Section: [[PROC2_SECTION]]
63 // CHECK-NEXT: BaseType: Null
64 // CHECK-NEXT: ComplexType: Null
65 // CHECK-NEXT: StorageClass: External
66 // CHECK-NEXT: AuxSymbolCount: 0
67 // CHECK-NEXT: }
69 .weak t3
70 t3 = foo
72 // CHECK: Symbol {
73 // CHECK: Name: t3
74 // CHECK-NEXT: Value: 0
75 // CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED
76 // CHECK-NEXT: BaseType: Null
77 // CHECK-NEXT: ComplexType: Null
78 // CHECK-NEXT: StorageClass: WeakExternal
79 // CHECK-NEXT: AuxSymbolCount: 1
80 // CHECK-NEXT: AuxWeakExternal {
81 // CHECK-NEXT: Linked: foo
82 // CHECK-NEXT: Search: Alias
83 // CHECK-NEXT: }
84 // CHECK-NEXT: }
86 .weak t4
87 t4 = bar
89 .globl bar
90 bar:
91 ret
93 // CHECK: Symbol {
94 // CHECK: Name: t4
95 // CHECK-NEXT: Value: 0
96 // CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED
97 // CHECK-NEXT: BaseType: Null
98 // CHECK-NEXT: ComplexType: Null
99 // CHECK-NEXT: StorageClass: WeakExternal
100 // CHECK-NEXT: AuxSymbolCount: 1
101 // CHECK-NEXT: AuxWeakExternal {
102 // CHECK-NEXT: Linked: bar
103 // CHECK-NEXT: Search: Alias
104 // CHECK-NEXT: }
105 // CHECK-NEXT: }
107 .weak t5
108 t5 = t2
110 // CHECK: Symbol {
111 // CHECK: Name: t5
112 // CHECK-NEXT: Value: 0
113 // CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED
114 // CHECK-NEXT: BaseType: Null
115 // CHECK-NEXT: ComplexType: Null
116 // CHECK-NEXT: StorageClass: WeakExternal
117 // CHECK-NEXT: AuxSymbolCount: 1
118 // CHECK-NEXT: AuxWeakExternal {
119 // CHECK-NEXT: Linked: t2
120 // CHECK-NEXT: Search: Alias
121 // CHECK-NEXT: }
122 // CHECK-NEXT: }