xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/memcpy-from-string.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -asm-verbose=false | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-unknown-linux-gnu"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker%0 = type { %1, i64, %2 }
7*9880d681SAndroid Build Coastguard Worker%1 = type { i8* }
8*9880d681SAndroid Build Coastguard Worker%2 = type { i64, [8 x i8] }
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker@0 = internal constant [10 x i8] c"asdf jkl;\00", align 1
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; Memcpy lowering should emit stores of immediates containing string data from
13*9880d681SAndroid Build Coastguard Worker; the correct offsets.
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: foo:
16*9880d681SAndroid Build Coastguard Worker; CHECK: movb  $0, 6(%rdi)
17*9880d681SAndroid Build Coastguard Worker; CHECK: movw  $15212, 4(%rdi)
18*9880d681SAndroid Build Coastguard Worker; CHECK: movl  $1802117222, (%rdi)
19*9880d681SAndroid Build Coastguard Workerdefine void @foo(i8* %tmp2) {
20*9880d681SAndroid Build Coastguard Worker  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)
21*9880d681SAndroid Build Coastguard Worker  ret void
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
25