comparison test/CodeGen/PowerPC/hello-reloc.s @ 77:54457678186b LLVM3.6

LLVM 3.6
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Mon, 08 Sep 2014 22:06:00 +0900
parents 95c75e76d11b
children afa8332a0e37
comparison
equal deleted inserted replaced
34:e874dbf0ad9d 77:54457678186b
1 ; This tests for the basic implementation of PPCMachObjectWriter.cpp, 1 ; This tests for the basic implementation of PPCMachObjectWriter.cpp,
2 ; which is responsible for writing mach-o relocation entries for (PIC) 2 ; which is responsible for writing mach-o relocation entries for (PIC)
3 ; PowerPC objects. 3 ; PowerPC objects.
4 ; NOTE: Darwin PPC asm syntax is not yet supported by PPCAsmParser,
5 ; so this test case uses ELF PPC asm syntax to produce a mach-o object.
6 ; Once PPCAsmParser supports darwin asm syntax, this test case should
7 ; be updated accordingly.
8 4
9 ; RUN: llvm-mc -filetype=obj -relocation-model=pic -mcpu=g4 -triple=powerpc-apple-darwin8 %s -o - | llvm-readobj -relocations | FileCheck -check-prefix=DARWIN-G4-DUMP %s 5 ; RUN: llvm-mc -filetype=obj -relocation-model=pic -mcpu=g4 -triple=powerpc-apple-darwin8 %s -o - | llvm-readobj -relocations | FileCheck -check-prefix=DARWIN-G4-DUMP %s
10 6
11 ; .machine ppc7400 7 .machine ppc7400
12 .section __TEXT,__textcoal_nt,coalesced,pure_instructions 8 .section __TEXT,__textcoal_nt,coalesced,pure_instructions
13 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 9 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
14 .section __TEXT,__text,regular,pure_instructions 10 .section __TEXT,__text,regular,pure_instructions
15 .globl _main 11 .globl _main
16 .align 4 12 .align 4
17 _main: ; @main 13 _main: ; @main
18 ; BB#0: ; %entry 14 ; BB#0: ; %entry
19 mflr 0 15 mflr r0
20 stw 31, -4(1) 16 stw r31, -4(r1)
21 stw 0, 8(1) 17 stw r0, 8(r1)
22 stwu 1, -80(1) 18 stwu r1, -80(r1)
23 bl L0$pb 19 bl L0$pb
24 L0$pb: 20 L0$pb:
25 mr 31, 1 21 mr r31, r1
26 li 5, 0 22 li r5, 0
27 mflr 2 23 mflr 2
28 stw 3, 68(31) 24 stw r3, 68(r31)
29 stw 5, 72(31) 25 stw r5, 72(r31)
30 stw 4, 64(31) 26 stw r4, 64(r31)
31 addis 2, 2, (L_.str-L0$pb)@ha 27 addis r2, r2, ha16(L_.str-L0$pb)
32 la 3, (L_.str-L0$pb)@l(2) 28 la r3, lo16(L_.str-L0$pb)(r2)
33 bl L_puts$stub 29 bl L_puts$stub
34 li 3, 0 30 li r3, 0
35 addi 1, 1, 80 31 addi r1, r1, 80
36 lwz 0, 8(1) 32 lwz r0, 8(r1)
37 lwz 31, -4(1) 33 lwz r31, -4(r1)
38 mtlr 0 34 mtlr r0
39 blr 35 blr
40 36
41 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 37 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
42 .align 4 38 .align 4
43 L_puts$stub: 39 L_puts$stub:
44 .indirect_symbol _puts 40 .indirect_symbol _puts
45 mflr 0 41 mflr r0
46 bcl 20, 31, L_puts$stub$tmp 42 bcl 20, 31, L_puts$stub$tmp
47 L_puts$stub$tmp: 43 L_puts$stub$tmp:
48 mflr 11 44 mflr r11
49 addis 11, 11, (L_puts$lazy_ptr-L_puts$stub$tmp)@ha 45 addis r11, r11, ha16(L_puts$lazy_ptr-L_puts$stub$tmp)
50 mtlr 0 46 mtlr r0
51 lwzu 12, (L_puts$lazy_ptr-L_puts$stub$tmp)@l(11) 47 lwzu r12, lo16(L_puts$lazy_ptr-L_puts$stub$tmp)(r11)
52 mtctr 12 48 mtctr r12
53 bctr 49 bctr
54 .section __DATA,__la_symbol_ptr,lazy_symbol_pointers 50 .section __DATA,__la_symbol_ptr,lazy_symbol_pointers
55 L_puts$lazy_ptr: 51 L_puts$lazy_ptr:
56 .indirect_symbol _puts 52 .indirect_symbol _puts
57 .long dyld_stub_binding_helper 53 .long dyld_stub_binding_helper
64 ; DARWIN-G4-DUMP:Format: Mach-O 32-bit ppc 60 ; DARWIN-G4-DUMP:Format: Mach-O 32-bit ppc
65 ; DARWIN-G4-DUMP:Arch: powerpc 61 ; DARWIN-G4-DUMP:Arch: powerpc
66 ; DARWIN-G4-DUMP:AddressSize: 32bit 62 ; DARWIN-G4-DUMP:AddressSize: 32bit
67 ; DARWIN-G4-DUMP:Relocations [ 63 ; DARWIN-G4-DUMP:Relocations [
68 ; DARWIN-G4-DUMP: Section __text { 64 ; DARWIN-G4-DUMP: Section __text {
69 ; DARWIN-G4-DUMP: 0x34 1 2 0 PPC_RELOC_BR24 0 - 65 ; DARWIN-G4-DUMP: 0x34 1 2 0 PPC_RELOC_BR24 0 0x3
70 ; DARWIN-G4-DUMP: 0x30 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main 66 ; DARWIN-G4-DUMP: 0x30 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x74
71 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 _main 67 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0x14
72 ; DARWIN-G4-DUMP: 0x2C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main 68 ; DARWIN-G4-DUMP: 0x2C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x74
73 ; DARWIN-G4-DUMP: 0x60 0 2 n/a PPC_RELOC_PAIR 1 _main 69 ; DARWIN-G4-DUMP: 0x60 0 2 n/a PPC_RELOC_PAIR 1 0x14
74 ; DARWIN-G4-DUMP: } 70 ; DARWIN-G4-DUMP: }
75 ; DARWIN-G4-DUMP: Section __picsymbolstub1 { 71 ; DARWIN-G4-DUMP: Section __picsymbolstub1 {
76 ; DARWIN-G4-DUMP: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main 72 ; DARWIN-G4-DUMP: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x70
77 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 _main 73 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0x58
78 ; DARWIN-G4-DUMP: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main 74 ; DARWIN-G4-DUMP: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x70
79 ; DARWIN-G4-DUMP: 0x18 0 2 n/a PPC_RELOC_PAIR 1 _main 75 ; DARWIN-G4-DUMP: 0x18 0 2 n/a PPC_RELOC_PAIR 1 0x58
80 ; DARWIN-G4-DUMP: } 76 ; DARWIN-G4-DUMP: }
81 ; DARWIN-G4-DUMP: Section __la_symbol_ptr { 77 ; DARWIN-G4-DUMP: Section __la_symbol_ptr {
82 ; DARWIN-G4-DUMP: 0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper 78 ; DARWIN-G4-DUMP: 0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper
83 ; DARWIN-G4-DUMP: } 79 ; DARWIN-G4-DUMP: }
84 ; DARWIN-G4-DUMP:] 80 ; DARWIN-G4-DUMP:]