diff options
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/userstack.ll')
| -rw-r--r-- | llvm/test/CodeGen/WebAssembly/userstack.ll | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/userstack.ll b/llvm/test/CodeGen/WebAssembly/userstack.ll index cc50192b66d..60158ee9fec 100644 --- a/llvm/test/CodeGen/WebAssembly/userstack.ll +++ b/llvm/test/CodeGen/WebAssembly/userstack.ll @@ -47,31 +47,37 @@ define void @alloca3264() { } ; CHECK-LABEL: allocarray: -; CHECK: .local i32, i32, i32, i32, i32, i32{{$}} +; CHECK: .local i32, i32, i32, i32, i32{{$}} define void @allocarray() { - ; CHECK: i32.const [[L1:.+]]=, __stack_pointer + ; CHECK-NEXT: i32.const [[L1:.+]]=, __stack_pointer ; CHECK-NEXT: i32.load [[L1]]=, 0([[L1]]) - ; CHECK-NEXT: i32.const [[L2:.+]]=, 32 + ; CHECK-NEXT: i32.const [[L2:.+]]=, 32{{$}} ; CHECK-NEXT: i32.sub [[SP:.+]]=, [[L1]], [[L2]] + ; CHECK-NEXT: i32.const [[L2]]=, __stack_pointer{{$}} + ; CHECK-NEXT: i32.store [[SP]]=, 0([[L2]]), [[SP]] %r = alloca [5 x i32] - ; CHECK: i32.const $push[[L3:.+]]=, 1 - ; CHECK: i32.store {{.*}}=, 12([[SP]]), $pop[[L3]] + + ; CHECK-NEXT: i32.const $push[[L4:.+]]=, 4 + ; CHECK-NEXT: i32.const [[L5:.+]]=, 12 + ; CHECK-NEXT: i32.add [[L5]]=, [[SP]], [[L5]] + ; CHECK-NEXT: i32.add $push[[L6:.+]]=, [[L5]], $pop[[L4]] + ; CHECK-NEXT: i32.const $push[[L9:.+]]=, 1{{$}} + ; CHECK-NEXT: i32.store $push[[L10:.+]]=, 12([[SP]]), $pop[[L9]]{{$}} + ; CHECK-NEXT: i32.store $discard=, 0($pop3), $pop[[L10]]{{$}} %p = getelementptr [5 x i32], [5 x i32]* %r, i32 0, i32 0 store i32 1, i32* %p - ; CHECK: i32.const $push[[L4:.+]]=, 4 - ; CHECK: i32.const [[L5:.+]]=, 12 - ; CHECK: i32.add [[L5]]=, [[SP]], [[L5]] - ; CHECK: i32.add $push[[L6:.+]]=, [[L5]], $pop[[L4]] - ; CHECK: i32.store {{.*}}=, 0($pop[[L6]]), ${{.+}} %p2 = getelementptr [5 x i32], [5 x i32]* %r, i32 0, i32 1 store i32 1, i32* %p2 - ; CHECK: i32.const [[L7:.+]]=, 32 + + ; CHECK-NEXT: i32.const [[L7:.+]]=, 32 ; CHECK-NEXT: i32.add [[SP]]=, [[SP]], [[L7]] ; CHECK-NEXT: i32.const [[L8:.+]]=, __stack_pointer - ; CHECK-NEXT: i32.store [[SP]]=, 0([[L7]]), [[SP]] + ; CHECK-NEXT: i32.store [[SP]]=, 0([[L8]]), [[SP]] ret void } +; CHECK-LABEL: allocarray_inbounds: +; CHECK: .local i32, i32, i32, i32{{$}} define void @allocarray_inbounds() { ; CHECK: i32.const [[L1:.+]]=, __stack_pointer ; CHECK-NEXT: i32.load [[L1]]=, 0([[L1]]) @@ -93,6 +99,7 @@ define void @allocarray_inbounds() { ret void } +; CHECK-LABEL: dynamic_alloca: define void @dynamic_alloca(i32 %alloc) { ; TODO: Support frame pointers ;%r = alloca i32, i32 %alloc |

