1 2 # RUN: llvm-mc -triple powerpc64-unknown-unknown -filetype=obj %s | \ 3 # RUN: llvm-readobj -s -sd | FileCheck %s 4 5 # This checks that fixups that can be resolved within the same 6 # object file are applied correctly. 7 8 .text 9 10 addi 1, 1, target 11 addis 1, 1, target 12 13 .set target, 0x1234 14 15 addi 1, 1, target2@l 16 addis 1, 1, target2@ha 17 18 .set target2, 0x12345678 19 20 addi 1, 1, target3-target4@l 21 addis 1, 1, target3-target4@ha 22 23 .set target3, 0x23455678 24 .set target4, 0x12341234 25 26 addi 1, 1, target5+0x8000@l 27 addis 1, 1, target5+0x8000@ha 28 29 .set target5, 0x10000001 30 31 1: 32 addi 1, 1, 2f-1b@l 33 addis 1, 1, 1b-2f@ha 34 2: 35 36 addi 1, 1, target6@h 37 addis 1, 1, target6@h 38 39 .set target6, 0x4321fedc 40 41 addi 1, 1, target7@higher 42 addis 1, 1, target7@highest 43 addi 1, 1, target7@highera 44 addis 1, 1, target7@highesta 45 46 .set target7, 0x1234ffffffff8000 47 48 .data 49 50 .quad v1 51 .long v2 52 .short v3 53 .byte v4 54 55 .set v1, 0x123456789abcdef0 56 .set v2, 0x87654321 57 .set v3, 0xbeef 58 .set v4, 0x42 59 60 # CHECK: Section { 61 # CHECK: Name: .text 62 # CHECK-NEXT: Type: SHT_PROGBITS 63 # CHECK-NEXT: Flags [ 64 # CHECK-NEXT: SHF_ALLOC 65 # CHECK-NEXT: SHF_EXECINSTR 66 # CHECK-NEXT: ] 67 # CHECK-NEXT: Address: 0x0 68 # CHECK-NEXT: Offset: 69 # CHECK-NEXT: Size: 64 70 # CHECK-NEXT: Link: 0 71 # CHECK-NEXT: Info: 0 72 # CHECK-NEXT: AddressAlignment: 4 73 # CHECK-NEXT: EntrySize: 0 74 # CHECK-NEXT: SectionData ( 75 # CHECK-NEXT: 0000: 38211234 3C211234 38215678 3C211234 76 # CHECK-NEXT: 0010: 38214444 3C211111 38218001 3C211001 77 # CHECK-NEXT: 0020: 38210008 3C210000 38214321 3C214321 78 # CHECK-NEXT: 0030: 3821FFFF 3C211234 38210000 3C211235 79 # CHECK-NEXT: ) 80 # CHECK-NEXT: } 81 82 # CHECK: Section { 83 # CHECK: Name: .data 84 # CHECK-NEXT: Type: SHT_PROGBITS 85 # CHECK-NEXT: Flags [ 86 # CHECK-NEXT: SHF_ALLOC 87 # CHECK-NEXT: SHF_WRITE 88 # CHECK-NEXT: ] 89 # CHECK-NEXT: Address: 0x0 90 # CHECK-NEXT: Offset: 91 # CHECK-NEXT: Size: 15 92 # CHECK-NEXT: Link: 0 93 # CHECK-NEXT: Info: 0 94 # CHECK-NEXT: AddressAlignment: 4 95 # CHECK-NEXT: EntrySize: 0 96 # CHECK-NEXT: SectionData ( 97 # CHECK-NEXT: 0000: 12345678 9ABCDEF0 87654321 BEEF42 98 # CHECK-NEXT: ) 99 # CHECK-NEXT: } 100 101