[X86][MC,LLD][NFC] Rename R_X86_64_REX2_GOTPCRELX (#116737)
[llvm-project.git] / lld / test / wasm / emit-relocs.s
blobbd136ba810b5ef36801f9dd34e3a394dd82c1831
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
2 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t.ret32.o
3 # RUN: wasm-ld --emit-relocs -o %t.wasm %t.o %t.ret32.o
4 # RUN: obj2yaml %t.wasm | FileCheck %s
6 .functype ret32 (f32) -> (i32)
8 unused_function:
9 .functype unused_function () -> ()
10 end_function
12 .globl _start
13 _start:
14 .functype _start () -> ()
15 f32.const 0.0
16 call ret32
17 drop
18 i32.const foo
19 drop
20 i32.const __stack_low
21 drop
22 end_function
24 .section .bss.data,"",@
25 .p2align 2
26 foo:
27 .int32 0
28 .size foo, 4
30 # CHECK: - Type: CODE
31 # CHECK-NEXT: Relocations:
32 # CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
33 # CHECK-NEXT: Index: 1
34 # CHECK-NEXT: Offset: 0x9
36 # CHECK: - Type: DATA
37 # CHECK-NEXT: Segments:
38 # CHECK-NEXT: - SectionOffset: 7
39 # CHECK-NEXT: InitFlags: 0
40 # CHECK-NEXT: Offset:
41 # CHECK-NEXT: Opcode: I32_CONST
42 # CHECK-NEXT: Value: 1024
43 # CHECK-NEXT: Content: '00000000'
45 # CHECK: - Type: CUSTOM
46 # CHECK-NEXT: Name: linking
47 # CHECK-NEXT: Version: 2
48 # CHECK-NEXT: SymbolTable:
49 # CHECK-NEXT: - Index: 0
50 # CHECK-NEXT: Kind: FUNCTION
51 # CHECK-NEXT: Name: _start
52 # CHECK-NEXT: Flags: [ ]
53 # CHECK-NEXT: Function: 0
54 # CHECK-NEXT: - Index: 1
55 # CHECK-NEXT: Kind: FUNCTION
56 # CHECK-NEXT: Name: ret32
57 # CHECK-NEXT: Flags: [ ]
58 # CHECK-NEXT: Function: 1
59 # CHECK-NEXT: - Index: 2
60 # CHECK-NEXT: Kind: DATA
61 # CHECK-NEXT: Name: __stack_low
62 # CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN, ABSOLUTE ]
63 # CHECK-NEXT: Offset: 1040
64 # CHECK-NEXT: Size: 0