1 ; Test that the --stack-first option places the stack at the start of linear
2 ; memory. In this case the --stack-first option is being passed along with a
3 ; stack size of 512. This means (since the stack grows down) the stack pointer
4 ; global should be initialized to 512.
5 ; Also test that __heap_base is still aligned with the --stack-first option.
7 RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/stack-first.s -o %t.o
8 RUN: wasm-ld -z stack-size=512 --stack-first --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o
9 RUN: obj2yaml %t.wasm | FileCheck %s
13 CHECK-NEXT: - Index: 0
15 CHECK-NEXT: Mutable: true
17 CHECK-NEXT: Opcode: I32_CONST
18 CHECK-NEXT: Value: 512
19 CHECK-NEXT: - Index: 1
21 CHECK-NEXT: Mutable: false
23 CHECK-NEXT: Opcode: I32_CONST
24 CHECK-NEXT: Value: 512
25 CHECK-NEXT: - Index: 2
27 CHECK-NEXT: Mutable: false
29 CHECK-NEXT: Opcode: I32_CONST
30 CHECK-NEXT: Value: 513
31 CHECK-NEXT: - Index: 3
33 CHECK-NEXT: Mutable: false
35 CHECK-NEXT: Opcode: I32_CONST
36 CHECK-NEXT: Value: 528
37 CHECK-NEXT: - Type: EXPORT
39 CHECK-NEXT: - Name: memory
40 CHECK-NEXT: Kind: MEMORY
42 CHECK-NEXT: - Name: _start
43 CHECK-NEXT: Kind: FUNCTION
45 CHECK-NEXT: - Name: someByte
46 CHECK-NEXT: Kind: GLOBAL
48 CHECK-NEXT: - Name: __data_end
49 CHECK-NEXT: Kind: GLOBAL
51 CHECK-NEXT: - Name: __heap_base
52 CHECK-NEXT: Kind: GLOBAL