xref: /llvm-project/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll (revision b1acb7a315e903ee340a33dbc9b2b61b0450bb67)
1; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s
2; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s
3
4; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
5; RUN: llvm-readobj --section-headers --file-header %t.o | \
6; RUN:   FileCheck --check-prefixes=OBJ,OBJ32 %s
7; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS,SYMS32 %s
8
9; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t64.o < %s
10; RUN: llvm-readobj --section-headers --file-header %t64.o | \
11; RUN:   FileCheck --check-prefixes=OBJ,OBJ64 %s
12; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefixes=SYMS,SYMS64 %s
13
14@a = internal global i32 0, align 4
15@b = internal global i64 0, align 8
16@c = internal global i16 0, align 2
17
18; CHECK:      .lcomm a,4,a[BS],2
19; CHECK-NEXT: .lcomm b,8,b[BS],3
20; CHECK-NEXT: .lcomm c,2,c[BS],1
21
22; OBJ:        Arch: powerpc
23; OBJ32-NEXT: AddressSize: 32bit
24; OBJ64-NEXT: AddressSize: 64bit
25; OBJ-NEXT:   FileHeader {
26; OBJ32-NEXT:   Magic: 0x1DF
27; OBJ64-NEXT:   Magic: 0x1F7
28; OBJ-NEXT:     NumberOfSections: 2
29; OBJ-NEXT:     TimeStamp:
30; OBJ32-NEXT:   SymbolTableOffset: 0x64
31; OBJ64-NEXT:   SymbolTableOffset: 0xA8
32; OBJ-NEXT:     SymbolTableEntries: 11
33; OBJ-NEXT:     OptionalHeaderSize: 0x0
34; OBJ-NEXT:     Flags: 0x0
35; OBJ-NEXT:   }
36; OBJ-NEXT:   Sections [
37; OBJ:          Section {{[{][[:space:]] *}}Index: 2
38; OBJ-NEXT:       Name: .bss
39; OBJ-NEXT:       PhysicalAddress: 0x0
40; OBJ-NEXT:       VirtualAddress: 0x0
41; OBJ-NEXT:       Size: 0x14
42; OBJ-NEXT:       RawDataOffset: 0x0
43; OBJ-NEXT:       RelocationPointer: 0x0
44; OBJ-NEXT:       LineNumberPointer: 0x0
45; OBJ-NEXT:       NumberOfRelocations: 0
46; OBJ-NEXT:       NumberOfLineNumbers: 0
47; OBJ-NEXT:       Type: STYP_BSS (0x80)
48; OBJ-NEXT:     }
49; OBJ-NEXT:   ]
50
51; SYMS:      Symbols [
52; SYMS:        Symbol {{[{][[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: a
53; SYMS-NEXT:     Value (RelocatableAddress): 0x0
54; SYMS-NEXT:     Section: .bss
55; SYMS-NEXT:     Type: 0x0
56; SYMS-NEXT:     StorageClass: C_HIDEXT (0x6B)
57; SYMS-NEXT:     NumberOfAuxEntries: 1
58; SYMS-NEXT:     CSECT Auxiliary Entry {
59; SYMS-NEXT:       Index: [[#Index + 1]]
60; SYMS-NEXT:       SectionLen: 4
61; SYMS-NEXT:       ParameterHashIndex: 0x0
62; SYMS-NEXT:       TypeChkSectNum: 0x0
63; SYMS-NEXT:       SymbolAlignmentLog2: 2
64; SYMS-NEXT:       SymbolType: XTY_CM (0x3)
65; SYMS-NEXT:       StorageMappingClass: XMC_BS (0x9)
66; SYMS32-NEXT:     StabInfoIndex: 0x0
67; SYMS32-NEXT:     StabSectNum: 0x0
68; SYMS64-NEXT:     Auxiliary Type: AUX_CSECT (0xFB)
69; SYMS-NEXT:     }
70; SYMS-NEXT:   }
71; SYMS-NEXT:   Symbol {
72; SYMS-NEXT:     Index: [[#Index + 2]]
73; SYMS-NEXT:     Name: b
74; SYMS-NEXT:     Value (RelocatableAddress): 0x8
75; SYMS-NEXT:     Section: .bss
76; SYMS-NEXT:     Type: 0x0
77; SYMS-NEXT:     StorageClass: C_HIDEXT (0x6B)
78; SYMS-NEXT:     NumberOfAuxEntries: 1
79; SYMS-NEXT:     CSECT Auxiliary Entry {
80; SYMS-NEXT:       Index: [[#Index + 3]]
81; SYMS-NEXT:       SectionLen: 8
82; SYMS-NEXT:       ParameterHashIndex: 0x0
83; SYMS-NEXT:       TypeChkSectNum: 0x0
84; SYMS-NEXT:       SymbolAlignmentLog2: 3
85; SYMS-NEXT:       SymbolType: XTY_CM (0x3)
86; SYMS-NEXT:       StorageMappingClass: XMC_BS (0x9)
87; SYMS32-NEXT:     StabInfoIndex: 0x0
88; SYMS32-NEXT:     StabSectNum: 0x0
89; SYMS64-NEXT:     Auxiliary Type: AUX_CSECT (0xFB)
90; SYMS-NEXT:     }
91; SYMS-NEXT:   }
92; SYMS-NEXT:   Symbol {
93; SYMS-NEXT:     Index: [[#Index + 4]]
94; SYMS-NEXT:     Name: c
95; SYMS-NEXT:     Value (RelocatableAddress): 0x10
96; SYMS-NEXT:     Section: .bss
97; SYMS-NEXT:     Type: 0x0
98; SYMS-NEXT:     StorageClass: C_HIDEXT (0x6B)
99; SYMS-NEXT:     NumberOfAuxEntries: 1
100; SYMS-NEXT:     CSECT Auxiliary Entry {
101; SYMS-NEXT:       Index: [[#Index + 5]]
102; SYMS-NEXT:       SectionLen: 2
103; SYMS-NEXT:       ParameterHashIndex: 0x0
104; SYMS-NEXT:       TypeChkSectNum: 0x0
105; SYMS-NEXT:       SymbolAlignmentLog2: 1
106; SYMS-NEXT:       SymbolType: XTY_CM (0x3)
107; SYMS-NEXT:       StorageMappingClass: XMC_BS (0x9)
108; SYMS32-NEXT:     StabInfoIndex: 0x0
109; SYMS32-NEXT:     StabSectNum: 0x0
110; SYMS64-NEXT:     Auxiliary Type: AUX_CSECT (0xFB)
111; SYMS-NEXT:     }
112; SYMS-NEXT:   }
113; SYMS-NEXT: ]
114