2022-10-07 14:09:44 +02:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
2009-02-28 18:18:58 +00:00
|
|
|
struct x { int a[100]; };
|
|
|
|
|
2019-08-14 11:13:10 +00:00
|
|
|
|
2009-02-28 18:18:58 +00:00
|
|
|
void foo(struct x *P, struct x *Q) {
|
2019-08-14 11:13:10 +00:00
|
|
|
// CHECK-LABEL: @foo(
|
2022-10-07 14:09:44 +02:00
|
|
|
// CHECK: call void @llvm.memcpy.p0.p0
|
2009-02-28 18:18:58 +00:00
|
|
|
*P = *Q;
|
|
|
|
}
|
2019-08-14 08:32:31 +00:00
|
|
|
|
2022-10-07 14:09:44 +02:00
|
|
|
// CHECK: declare void @llvm.memcpy.p0.p0{{.*}}(ptr noalias nocapture writeonly, ptr noalias nocapture readonly
|
2019-08-14 08:32:31 +00:00
|
|
|
|
|
|
|
void bar(struct x *P, struct x *Q) {
|
2019-08-14 11:13:10 +00:00
|
|
|
// CHECK-LABEL: @bar(
|
2022-10-07 14:09:44 +02:00
|
|
|
// CHECK: call void @llvm.memcpy.p0.p0
|
2019-08-14 08:32:31 +00:00
|
|
|
__builtin_memcpy(P, Q, sizeof(struct x));
|
|
|
|
}
|