1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
2 ; RUN: -data-sections=false < %s | FileCheck --check-prefix=ASM %s
4 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
5 ; RUN: -data-sections=true < %s | FileCheck --check-prefix=ASM-DATASECT %s
7 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
8 ; RUN: -data-sections=false -filetype=obj -o %t.o < %s
9 ; RUN: llvm-objdump -dr %t.o | FileCheck --check-prefix=OBJ %s
10 ; RUN: llvm-objdump --syms %t.o | FileCheck --check-prefix=SYM %s
12 @_MergedGlobals = global <{ i32, i32 }> <{ i32 1, i32 2 }>, align 4
13 @var1 = alias i32, getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 0)
14 @var2 = alias i32, getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 1)
15 @var3 = alias i32, ptr @var2
17 define void @foo(i32 %a1, i32 %a2, i32 %a3) {
18 store i32 %a1, ptr getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 0), align 4
19 store i32 %a2, ptr getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 1), align 4
23 ; ASM: # -- End function
24 ; ASM-NEXT: .csect .data[RW],2
25 ; ASM-NEXT: .globl _MergedGlobals # @_MergedGlobals
26 ; ASM-NEXT: .globl var1
27 ; ASM-NEXT: .globl var2
28 ; ASM-NEXT: .globl var3
30 ; ASM-NEXT: _MergedGlobals:
32 ; ASM-NEXT: .vbyte 4, 1 # 0x1
35 ; ASM-NEXT: .vbyte 4, 2 # 0x2
38 ; ASM-NEXT: .tc _MergedGlobals[TC],_MergedGlobals
40 ; ASM-DATASECT: # -- End function
41 ; ASM-DATASECT-NEXT: .csect _MergedGlobals[RW],2
42 ; ASM-DATASECT-NEXT: .globl _MergedGlobals[RW] # @_MergedGlobals
43 ; ASM-DATASECT-NEXT: .globl var1
44 ; ASM-DATASECT-NEXT: .globl var2
45 ; ASM-DATASECT-NEXT: .globl var3
46 ; ASM-DATASECT-NEXT: .align 2
47 ; ASM-DATASECT-NEXT: var1:
48 ; ASM-DATASECT-NEXT: .vbyte 4, 1 # 0x1
49 ; ASM-DATASECT-NEXT: var2:
50 ; ASM-DATASECT-NEXT: var3:
51 ; ASM-DATASECT-NEXT: .vbyte 4, 2 # 0x2
52 ; ASM-DATASECT-NEXT: .toc
53 ; ASM-DATASECT-NEXT: L..C0:
54 ; ASM-DATASECT-NEXT: .tc _MergedGlobals[TC],_MergedGlobals[RW]
56 ; OBJ: 00000000 <.foo>:
57 ; OBJ-NEXT: 0: 80 a2 00 00 lwz 5, 0(2)
58 ; OBJ-NEXT: 00000002: R_TOC _MergedGlobals
59 ; OBJ-NEXT: 4: 90 65 00 00 stw 3, 0(5)
60 ; OBJ-NEXT: 8: 90 85 00 04 stw 4, 4(5)
61 ; OBJ-NEXT: c: 4e 80 00 20 blr
64 ; SYM-NEXT: 00000000 df *DEBUG* 00000000 <stdin>
65 ; SYM-NEXT: 00000000 l .text 00000029
66 ; SYM-NEXT: 00000000 g F .text (csect: ) 00000000 .foo
67 ; SYM-NEXT: 0000002c l .data 00000008 .data
68 ; SYM-NEXT: 0000002c g O .data (csect: .data) 00000000 _MergedGlobals
69 ; SYM-NEXT: 0000002c g O .data (csect: .data) 00000000 var1
70 ; SYM-NEXT: 00000030 g O .data (csect: .data) 00000000 var2
71 ; SYM-NEXT: 00000030 g O .data (csect: .data) 00000000 var3
72 ; SYM-NEXT: 00000034 g O .data 0000000c foo
73 ; SYM-NEXT: 00000040 l .data 00000000 TOC
74 ; SYM-NEXT: 00000040 l O .data 00000004 _MergedGlobals