summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/global.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/global.ll')
-rw-r--r--llvm/test/CodeGen/WebAssembly/global.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/global.ll b/llvm/test/CodeGen/WebAssembly/global.ll
index 489e932fbbc..4fd1b083591 100644
--- a/llvm/test/CodeGen/WebAssembly/global.ll
+++ b/llvm/test/CodeGen/WebAssembly/global.ll
@@ -18,6 +18,18 @@ define i32 @foo() {
ret i32 %a
}
+; CHECK-LABEL: call_memcpy:
+; CHECK-NEXT: .param i32, i32, i32{{$}}
+; CHECK-NEXT: .result i32{{$}}
+; CHECK-NEXT: i32.const $push0=, memcpy{{$}}
+; CHECK-NEXT: call_indirect $pop0, $0, $1, $2{{$}}
+; CHECK-NEXT: return $0{{$}}
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1)
+define i8* @call_memcpy(i8* %p, i8* nocapture readonly %q, i32 %n) {
+ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i32 1, i1 false)
+ ret i8* %p
+}
+
; CHECK: .type g,@object
; CHECK: .align 2{{$}}
; CHECK-NEXT: g:
OpenPOWER on IntegriCloud