@@ -8,6 +8,15 @@ RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/stack-first.
88RUN: wasm-ld -z stack-size=512 --stack-first --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o
99RUN: obj2yaml %t.wasm | FileCheck %s
1010
11+ ; Check `--no-stack-first`
12+ RUN: wasm-ld -z stack-size=512 --stack-first --no-stack-first --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o
13+ RUN: obj2yaml %t.wasm | FileCheck %s --check-prefix=NOT-FIRST
14+
15+ ; Check that the default is no-stack-first
16+ RUN: wasm-ld -z stack-size=512 --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o
17+ RUN: obj2yaml %t.wasm | FileCheck %s --check-prefix=NOT-FIRST
18+
19+
1120CHECK: - Type: GLOBAL
1221CHECK-NEXT: Globals:
1322CHECK-NEXT: - Index: 0
@@ -51,3 +60,19 @@ CHECK-NEXT: Index: 2
5160CHECK-NEXT: - Name: __heap_base
5261CHECK-NEXT: Kind: GLOBAL
5362CHECK-NEXT: Index: 3
63+
64+ NOT-FIRST: - Type: GLOBAL
65+ NOT-FIRST-NEXT: Globals:
66+ NOT-FIRST-NEXT: - Index: 0
67+ NOT-FIRST-NEXT: Type: I32
68+ NOT-FIRST-NEXT: Mutable: true
69+ NOT-FIRST-NEXT: InitExpr:
70+ NOT-FIRST-NEXT: Opcode: I32_CONST
71+ NOT-FIRST-NEXT: Value: 1552
72+ NOT-FIRST-NEXT: - Index: 1
73+ NOT-FIRST-NEXT: Type: I32
74+ NOT-FIRST-NEXT: Mutable: false
75+ NOT-FIRST-NEXT: InitExpr:
76+ NOT-FIRST-NEXT: Opcode: I32_CONST
77+ NOT-FIRST-NEXT: Value: 1024
78+
0 commit comments