2019-08-14 16:32:31 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
2009-03-01 02:18:58 +08:00
|
|
|
struct x { int a[100]; };
|
|
|
|
|
2019-08-14 19:13:10 +08:00
|
|
|
|
2009-03-01 02:18:58 +08:00
|
|
|
void foo(struct x *P, struct x *Q) {
|
2019-08-14 19:13:10 +08:00
|
|
|
// CHECK-LABEL: @foo(
|
2019-08-14 23:35:40 +08:00
|
|
|
// CHECK: call void @llvm.memcpy.p0i8.p0i8
|
2009-03-01 02:18:58 +08:00
|
|
|
*P = *Q;
|
|
|
|
}
|
2019-08-14 16:32:31 +08:00
|
|
|
|
2019-08-14 23:35:40 +08:00
|
|
|
// CHECK: declare void @llvm.memcpy.p0i8.p0i8{{.*}}(i8* noalias nocapture writeonly, i8* noalias nocapture readonly
|
2019-08-14 16:32:31 +08:00
|
|
|
|
|
|
|
void bar(struct x *P, struct x *Q) {
|
2019-08-14 19:13:10 +08:00
|
|
|
// CHECK-LABEL: @bar(
|
2019-08-14 23:35:40 +08:00
|
|
|
// CHECK: call void @llvm.memcpy.p0i8.p0i8
|
2019-08-14 16:32:31 +08:00
|
|
|
__builtin_memcpy(P, Q, sizeof(struct x));
|
|
|
|
}
|