1 ; RUN: llc -filetype=obj -wasm-keep-registers %s -o - | llvm-readobj -r --expand-relocs | FileCheck %s
3 target triple = "wasm32-unknown-unknown"
5 ; Pointers to functions of two different types
6 @a = global i64 ()* inttoptr (i64 5 to i64 ()*), align 8
7 @b = global i32 ()* inttoptr (i32 7 to i32 ()*), align 8
15 %aa = load i64 ()*, i64 ()** @a, align 8
16 %bb = load i32 ()*, i32 ()** @b, align 8
17 %tmp1 = call i64 %aa()
18 %tmp2 = call i32 %bb()
26 ; CHECK: Relocations [
27 ; CHECK-NEXT: Section (5) CODE {
28 ; CHECK-NEXT: Relocation {
29 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LEB (3)
30 ; CHECK-NEXT: Offset: 0x9
31 ; CHECK-NEXT: Symbol: b
32 ; CHECK-NEXT: Addend: 0
34 ; CHECK-NEXT: Relocation {
35 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LEB (3)
36 ; CHECK-NEXT: Offset: 0x14
37 ; CHECK-NEXT: Symbol: a
38 ; CHECK-NEXT: Addend: 0
40 ; CHECK-NEXT: Relocation {
41 ; CHECK-NEXT: Type: R_WASM_TYPE_INDEX_LEB (6)
42 ; CHECK-NEXT: Offset: 0x1A
43 ; CHECK-NEXT: Index: 0x1
45 ; CHECK-NEXT: Relocation {
46 ; CHECK-NEXT: Type: R_WASM_TYPE_INDEX_LEB (6)
47 ; CHECK-NEXT: Offset: 0x24
48 ; CHECK-NEXT: Index: 0x0
50 ; CHECK-NEXT: Relocation {
51 ; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
52 ; CHECK-NEXT: Offset: 0x2D
53 ; CHECK-NEXT: Symbol: c
55 ; CHECK-NEXT: Relocation {
56 ; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
57 ; CHECK-NEXT: Offset: 0x34
58 ; CHECK-NEXT: Symbol: d