1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec < %s | \
2 ; RUN: FileCheck --check-prefix=CHECK32 %s
4 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 -mattr=-altivec < %s | \
5 ; RUN: FileCheck --check-prefix=CHECK64 %s
7 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
8 ; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s
9 ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM32 %s
10 ; RUN: llvm-objdump -r -d --symbol-description %t.o | FileCheck -D#NFA=2 --check-prefixes=CHECKRELOC,CHECKRELOC32 %s
12 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
13 ; RUN: -mattr=-altivec -filetype=obj -o %t64.o < %s
14 ; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM64 %s
15 ; RUN: llvm-objdump -r -d --symbol-description %t64.o | FileCheck -D#NFA=2 --check-prefixes=CHECKRELOC,CHECKRELOC64 %s
17 %struct.S = type { i32, i32 }
19 @s = external global %struct.S, align 4
23 %0 = load i32, ptr getelementptr inbounds (%struct.S, ptr @s, i32 0, i32 1), align 4
24 %1 = trunc i32 %0 to i8
25 %2 = load i32, ptr getelementptr inbounds (%struct.S, ptr @s, i32 0, i32 1), align 4
26 call void @llvm.memset.p0.i32(ptr align 4 @s, i8 %1, i32 %2, i1 false)
30 declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg)
33 ; CHECK-NEXT: # %bb.0: # %entry
36 ; CHECK32: bl .___memset
37 ; CHECK32: .extern .___memset
38 ; CHECK64: bl .___memset64
39 ; CHECK64: .extern .___memset64
42 ; CHECKSYM-NEXT: Index: 0
43 ; CHECKSYM-NEXT: Name: .file
44 ; CHECKSYM-NEXT: Value (SymbolTableIndex): 0x0
45 ; CHECKSYM-NEXT: Section: N_DEBUG
46 ; CHECKSYM-NEXT: Source Language ID: TB_CPLUSPLUS (0x9)
47 ; CHECKSYM32-NEXT: CPU Version ID: TCPU_COM (0x3)
48 ; CHECKSYM64-NEXT: CPU Version ID: TCPU_PPC64 (0x2)
49 ; CHECKSYM-NEXT: StorageClass: C_FILE (0x67)
50 ; CHECKSYM-NEXT: NumberOfAuxEntries: 2
54 ; CHECKSYM32-NEXT: Name: .___memset
55 ; CHECKSYM64-NEXT: Name: .___memset64
56 ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0
57 ; CHECKSYM-NEXT: Section: N_UNDEF
58 ; CHECKSYM-NEXT: Type: 0x0
59 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
60 ; CHECKSYM-NEXT: NumberOfAuxEntries: 1
61 ; CHECKSYM-NEXT: CSECT Auxiliary Entry {
62 ; CHECKSYM-NEXT: Index: 4
63 ; CHECKSYM-NEXT: SectionLen: 0
64 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0
65 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0
66 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
67 ; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
68 ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
69 ; CHECKSYM32-NEXT: StabInfoIndex: 0x0
70 ; CHECKSYM32-NEXT: StabSectNum: 0x0
71 ; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
75 ; CHECKRELOC32: 00000000 (idx: [[#NFA+7]]) .bar:
76 ; CHECKRELOC64: 0000000000000000 (idx: [[#NFA+7]]) .bar:
77 ; CHECKRELOC-NEXT: 0: 7c 08 02 a6 mflr 0
78 ; CHECKRELOC32-NEXT: 4: 94 21 ff c0 stwu 1, -64(1)
79 ; CHECKRELOC32-NEXT: 8: 80 62 00 00 lwz 3, 0(2)
80 ; CHECKRELOC32-NEXT: 0000000a: R_TOC (idx: [[#NFA+13]]) s[TC]
81 ; CHECKRELOC32-NEXT: c: 90 01 00 48 stw 0, 72(1)
82 ; CHECKRELOC64-NEXT: 4: f8 21 ff 91 stdu 1, -112(1)
83 ; CHECKRELOC64-NEXT: 8: e8 62 00 00 ld 3, 0(2)
84 ; CHECKRELOC64-NEXT: 000000000000000a: R_TOC (idx: [[#NFA+13]]) s[TC]
85 ; CHECKRELOC64-NEXT: c: f8 01 00 80 std 0, 128(1)
86 ; CHECKRELOC-NEXT: 10: 80 83 00 04 lwz 4, 4(3)
87 ; CHECKRELOC-NEXT: 14: 7c 85 23 78 mr 5, 4
88 ; CHECKRELOC-NEXT: 18: 4b ff ff e9 bl 0x0
89 ; CHECKRELOC32-NEXT: 00000018: R_RBR (idx: [[#NFA+1]]) .___memset[PR]
90 ; CHECKRELOC64-NEXT: 0000000000000018: R_RBR (idx: [[#NFA+1]]) .___memset64[PR]