Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / WebAssembly / stack-ptr.ll
blobb92c773c085fafe72be4adb9fc0271038a3a1581
1 ; RUN: llc --mtriple=wasm32-unknown-unknown -filetype=obj %s -o - | obj2yaml | FileCheck --check-prefixes CHECK,CHK32 %s
2 ; RUN: llc --mtriple=wasm64-unknown-unknown -filetype=obj %s -o - | obj2yaml | FileCheck --check-prefixes CHECK,CHK64 %s
4 ; Function that uses explict stack, and should generate a reference to
5 ; __stack_pointer, along with the corresponding reloction entry.
6 define hidden void @foo() #0 {
7 entry:
8   alloca i32, align 4
9   ret void
12 ; CHECK:  - Type:            IMPORT
13 ; CHECK:     Imports:
14 ; CHECK:       - Module:          env
15 ; CHECK:         Field:           __stack_pointer
16 ; CHECK:         Kind:            GLOBAL
17 ; CHK32:         GlobalType:      I32
18 ; CHK64:         GlobalType:      I64
19 ; CHECK:         GlobalMutable:   true
20 ; CHECK:   - Type:            CODE
21 ; CHECK:     Relocations:
22 ; CHECK:       - Type:            R_WASM_GLOBAL_INDEX_LEB
23 ; CHECK:         Index:           0