1// RUN: llvm-mc -triple x86_64-apple-darwin14 %s -filetype=obj -o - | llvm-readobj -r --expand-relocs | FileCheck %s 2 3// Test that we "S + K" produce a relocation with a symbol, but just S produces 4// a relocation with the section. 5 6 .section __TEXT,__literal4,4byte_literals 7L0: 8 .long 42 9 10 .section __TEXT,__cstring,cstring_literals 11L1: 12 .asciz "42" 13 14 .section __DATA,__data 15 .quad L0 16 .quad L0 + 1 17 .quad L1 18 .quad L1 + 1 19 20// CHECK: Relocations [ 21// CHECK-NEXT: Section __data { 22// CHECK-NEXT: Relocation { 23// CHECK-NEXT: Offset: 0x18 24// CHECK-NEXT: PCRel: 0 25// CHECK-NEXT: Length: 3 26// CHECK-NEXT: Type: X86_64_RELOC_UNSIGNED (0) 27// CHECK-NEXT: Symbol: L1 28// CHECK-NEXT: } 29// CHECK-NEXT: Relocation { 30// CHECK-NEXT: Offset: 0x10 31// CHECK-NEXT: PCRel: 0 32// CHECK-NEXT: Length: 3 33// CHECK-NEXT: Type: X86_64_RELOC_UNSIGNED (0) 34// CHECK-NEXT: Section: __cstring (3) 35// CHECK-NEXT: } 36// CHECK-NEXT: Relocation { 37// CHECK-NEXT: Offset: 0x8 38// CHECK-NEXT: PCRel: 0 39// CHECK-NEXT: Length: 3 40// CHECK-NEXT: Type: X86_64_RELOC_UNSIGNED (0) 41// CHECK-NEXT: Symbol: L0 42// CHECK-NEXT: } 43// CHECK-NEXT: Relocation { 44// CHECK-NEXT: Offset: 0x0 45// CHECK-NEXT: PCRel: 0 46// CHECK-NEXT: Length: 3 47// CHECK-NEXT: Type: X86_64_RELOC_UNSIGNED (0) 48// CHECK-NEXT: Section: __literal4 (2) 49// CHECK-NEXT: } 50// CHECK-NEXT: } 51// CHECK-NEXT: ] 52