[MC] Don't use the architecture to govern which object file format to use
[oota-llvm.git] / test / MC / COFF / alias.s
1 // RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - \
2 // RUN:   | llvm-readobj -t -r | FileCheck %s
3
4 local1:
5 external_aliased_to_local = local1
6
7         .globl  global_aliased_to_external
8 global_aliased_to_external = external1
9
10         .globl  global_aliased_to_local
11 local2:
12 global_aliased_to_local = local2
13
14         .weak   weak_aliased_to_external
15 weak_aliased_to_external = external2
16
17 // Generate relocs against the above aliases.
18         .long external_aliased_to_local
19         .long global_aliased_to_external
20         .long global_aliased_to_local
21         .long weak_aliased_to_external
22
23 // CHECK:      Relocations [
24 // CHECK:        0x0 IMAGE_REL_I386_DIR32 external_aliased_to_local
25 // CHECK:        0x4 IMAGE_REL_I386_DIR32 external1
26 // CHECK:        0x8 IMAGE_REL_I386_DIR32 global_aliased_to_local
27 // CHECK:        0xC IMAGE_REL_I386_DIR32 external2
28 // CHECK:      ]
29 // CHECK:      Symbols [
30 // CHECK-NEXT:   Symbol {
31 // CHECK-NEXT:     Name: .text
32 // CHECK-NEXT:     Value: 0
33 // CHECK-NEXT:     Section: .text (1)
34 // CHECK-NEXT:     BaseType: Null (0x0)
35 // CHECK-NEXT:     ComplexType: Null (0x0)
36 // CHECK-NEXT:     StorageClass: Static (0x3)
37 // CHECK-NEXT:     AuxSymbolCount: 1
38 // CHECK:        }
39 // CHECK:        Symbol {
40 // CHECK:          Name: local1
41 // CHECK-NEXT:     Value: 0
42 // CHECK-NEXT:     Section: .text (1)
43 // CHECK-NEXT:     BaseType: Null (0x0)
44 // CHECK-NEXT:     ComplexType: Null (0x0)
45 // CHECK-NEXT:     StorageClass: Static (0x3)
46 // CHECK-NEXT:     AuxSymbolCount: 0
47 // CHECK-NEXT:   }
48 // CHECK-NEXT:   Symbol {
49 // CHECK:          Name: global_aliased_to_external
50 // CHECK-NEXT:     Value: 0
51 // CHECK-NEXT:     Section: IMAGE_SYM_UNDEFINED (0)
52 // CHECK-NEXT:     BaseType: Null (0x0)
53 // CHECK-NEXT:     ComplexType: Null (0x0)
54 // CHECK-NEXT:     StorageClass: External (0x2)
55 // CHECK-NEXT:     AuxSymbolCount: 0
56 // CHECK-NEXT:   }
57 // CHECK-NEXT:   Symbol {
58 // CHECK-NEXT:     Name: external1
59 // CHECK-NEXT:     Value: 0
60 // CHECK-NEXT:     Section: IMAGE_SYM_UNDEFINED (0)
61 // CHECK-NEXT:     BaseType: Null (0x0)
62 // CHECK-NEXT:     ComplexType: Null (0x0)
63 // CHECK-NEXT:     StorageClass: External (0x2)
64 // CHECK-NEXT:     AuxSymbolCount: 0
65 // CHECK-NEXT:   }
66 // CHECK-NEXT:   Symbol {
67 // CHECK-NEXT:     Name: global_aliased_to_local
68 // CHECK-NEXT:     Value: 0
69 // CHECK-NEXT:     Section: .text (1)
70 // CHECK-NEXT:     BaseType: Null (0x0)
71 // CHECK-NEXT:     ComplexType: Null (0x0)
72 // CHECK-NEXT:     StorageClass: External (0x2)
73 // CHECK-NEXT:     AuxSymbolCount: 0
74 // CHECK-NEXT:   }
75 // CHECK-NEXT:   Symbol {
76 // CHECK-NEXT:     Name: local2
77 // CHECK-NEXT:     Value: 0
78 // CHECK-NEXT:     Section: .text (1)
79 // CHECK-NEXT:     BaseType: Null (0x0)
80 // CHECK-NEXT:     ComplexType: Null (0x0)
81 // CHECK-NEXT:     StorageClass: Static (0x3)
82 // CHECK-NEXT:     AuxSymbolCount: 0
83 // CHECK-NEXT:   }
84 // CHECK-NEXT:   Symbol {
85 // CHECK-NEXT:     Name: weak_aliased_to_external
86 // CHECK-NEXT:     Value: 0
87 // CHECK-NEXT:     Section: IMAGE_SYM_UNDEFINED (0)
88 // CHECK-NEXT:     BaseType: Null (0x0)
89 // CHECK-NEXT:     ComplexType: Null (0x0)
90 // CHECK-NEXT:     StorageClass: WeakExternal (0x69)
91 // CHECK-NEXT:     AuxSymbolCount: 1
92 // CHECK-NEXT:     AuxWeakExternal {
93 // CHECK-NEXT:       Linked: external2
94 // CHECK-NEXT:       Search: Library (0x2)
95 // CHECK-NEXT:     }
96 // CHECK-NEXT:   }
97 // CHECK-NEXT:   Symbol {
98 // CHECK-NEXT:     Name: external2
99 // CHECK-NEXT:     Value: 0
100 // CHECK-NEXT:     Section: IMAGE_SYM_UNDEFINED (0)
101 // CHECK-NEXT:     BaseType: Null (0x0)
102 // CHECK-NEXT:     ComplexType: Null (0x0)
103 // CHECK-NEXT:     StorageClass: External (0x2)
104 // CHECK-NEXT:     AuxSymbolCount: 0
105 // CHECK-NEXT:   }
106 // CHECK-NEXT: ]