summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/memcpy-from-string.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/X86/memcpy-from-string.ll')
-rw-r--r--llvm/test/CodeGen/X86/memcpy-from-string.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/memcpy-from-string.ll b/llvm/test/CodeGen/X86/memcpy-from-string.ll
new file mode 100644
index 00000000000..d62d9e20254
--- /dev/null
+++ b/llvm/test/CodeGen/X86/memcpy-from-string.ll
@@ -0,0 +1,24 @@
+; RUN: llc < %s -asm-verbose=false | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+%0 = type { %1, i64, %2 }
+%1 = type { i8* }
+%2 = type { i64, [8 x i8] }
+
+@0 = internal constant [10 x i8] c"asdf jkl;\00", align 1
+
+; Memcpy lowering should emit stores of immediates containing string data from
+; the correct offsets.
+
+; CHECK-LABEL: foo:
+; CHECK: movb $0, 6(%rdi)
+; CHECK: movw $15212, 4(%rdi)
+; CHECK: movl $1802117222, (%rdi)
+define void @foo(i8* %tmp2) {
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @0, i64 0, i64 3), i64 7, i32 1, i1 false)
+ ret void
+}
+
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
OpenPOWER on IntegriCloud