1; RUN: llc -O0 -filetype=obj %s -o - | llvm-readobj -r --expand-relocs - | FileCheck %s 2 3target triple = "wasm32-unknown-unknown" 4 5; foo and bar are external and internal symbols. a and b are pointers 6; initialized to these locations offset by 2 and -2 elements respecitively. 7 8@foo = external global i32, align 4 9@bar = global i64 7, align 4 10@a = global i32* getelementptr (i32, i32* @foo, i32 2), align 8 11@b = global i64* getelementptr (i64, i64* @bar, i64 -2), align 8 12@c = global [3 x i32*] [i32* @foo, i32* @foo, i32* @foo], align 16 13 14; CHECK: Format: WASM 15; CHECK: Relocations [ 16; CHECK-NEXT: Section (3) DATA { 17; CHECK-NEXT: Relocation { 18; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) 19; CHECK-NEXT: Offset: 0x13 20; CHECK-NEXT: Symbol: foo 21; CHECK-NEXT: Addend: 8 22; CHECK-NEXT: } 23; CHECK-NEXT: Relocation { 24; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) 25; CHECK-NEXT: Offset: 0x1C 26; CHECK-NEXT: Symbol: bar 27; CHECK-NEXT: Addend: -16 28; CHECK-NEXT: } 29; CHECK-NEXT: Relocation { 30; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) 31; CHECK-NEXT: Offset: 0x25 32; CHECK-NEXT: Symbol: foo 33; CHECK-NEXT: Addend: 0 34; CHECK-NEXT: } 35; CHECK-NEXT: Relocation { 36; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) 37; CHECK-NEXT: Offset: 0x29 38; CHECK-NEXT: Symbol: foo 39; CHECK-NEXT: Addend: 0 40; CHECK-NEXT: } 41; CHECK-NEXT: Relocation { 42; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) 43; CHECK-NEXT: Offset: 0x2D 44; CHECK-NEXT: Symbol: foo 45; CHECK-NEXT: Addend: 0 46; CHECK-NEXT: } 47; CHECK-NEXT: } 48; CHECK-NEXT: ] 49