Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / wasm / reloc-relative.s
blobfde1d1dd08247d11311794e1c85426b95deb25ae
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/hello.s -o %t.hello32.o
2 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
3 # RUN: wasm-ld --no-entry --no-gc-sections --allow-undefined -fatal-warnings -o %t.wasm %t.o %t.hello32.o
4 # RUN: obj2yaml %t.wasm | FileCheck %s
6 .section .x_sec,"",@
7 internal_x_seg_pad:
8 # padding for provisioning value assertion
9 .int32 0
10 .size internal_x_seg_pad, 4
11 internal_x_seg:
12 .int32 42
13 .size internal_x_seg, 4
15 # internal cross segment subtraction
16 .section .foo,"",@
17 .globl foo
18 foo:
19 .int32 internal_x_seg - foo
20 .size foo, 4
21 foo_addend:
22 .int32 internal_x_seg - foo
23 .size foo_addend, 4
25 # external cross segment subtraction
26 .section .bar,"",@
27 .globl bar
28 bar:
29 .int32 hello_str - bar
30 .size bar, 4
31 bar_addend:
32 .int32 hello_str - bar
33 .size bar_addend, 4
35 # positive calc result
36 .section .fizz,"",@
37 .globl fizz
38 fizz:
39 .int32 far - fizz
40 .size fizz, 4
41 fizz_addend:
42 .int32 far - fizz
43 .size fizz_addend, 4
45 .section .far,"",@
46 .globl far
47 far:
48 .int32 21
49 .size far, 4
51 # CHECK: - Type: DATA
52 # CHECK-NEXT: Segments:
53 # CHECK-NEXT: - SectionOffset: 7
54 # CHECK-NEXT: InitFlags: 0
55 # CHECK-NEXT: Offset:
56 # CHECK-NEXT: Opcode: I32_CONST
57 # CHECK-NEXT: Value: 1024
58 # CHECK-NEXT: Content: 68656C6C6F0A00
59 # CHECK-NEXT: - SectionOffset: 20
60 # CHECK-NEXT: InitFlags: 0
61 # CHECK-NEXT: Offset:
62 # CHECK-NEXT: Opcode: I32_CONST
63 # CHECK-NEXT: Value: 1031
64 # CHECK-NEXT: Content: 000000002A000000
65 # CHECK-NEXT: - SectionOffset: 34
66 # CHECK-NEXT: InitFlags: 0
67 # CHECK-NEXT: Offset:
68 # CHECK-NEXT: Opcode: I32_CONST
69 # CHECK-NEXT: Value: 1039
70 # CHECK-NEXT: Content: FCFFFFFFFCFFFFFF
71 # CHECK-NEXT: - SectionOffset: 48
72 # CHECK-NEXT: InitFlags: 0
73 # CHECK-NEXT: Offset:
74 # CHECK-NEXT: Opcode: I32_CONST
75 # CHECK-NEXT: Value: 1047
76 # CHECK-NEXT: Content: E9FFFFFFE9FFFFFF
77 # CHECK-NEXT: - SectionOffset: 62
78 # CHECK-NEXT: InitFlags: 0
79 # CHECK-NEXT: Offset:
80 # CHECK-NEXT: Opcode: I32_CONST
81 # CHECK-NEXT: Value: 1055
82 # CHECK-NEXT: Content: '0800000008000000'
83 # CHECK-NEXT: - SectionOffset: 76
84 # CHECK-NEXT: InitFlags: 0
85 # CHECK-NEXT: Offset:
86 # CHECK-NEXT: Opcode: I32_CONST
87 # CHECK-NEXT: Value: 1063
88 # CHECK-NEXT: Content: '15000000'