1 // RUN: %clang_cc1 -no-opaque-pointers -emit-llvm %s -o - | FileCheck %s
2 struct x { int a[100]; };
3
4
foo(struct x * P,struct x * Q)5 void foo(struct x *P, struct x *Q) {
6 // CHECK-LABEL: @foo(
7 // CHECK: call void @llvm.memcpy.p0i8.p0i8
8 *P = *Q;
9 }
10
11 // CHECK: declare void @llvm.memcpy.p0i8.p0i8{{.*}}(i8* noalias nocapture writeonly, i8* noalias nocapture readonly
12
bar(struct x * P,struct x * Q)13 void bar(struct x *P, struct x *Q) {
14 // CHECK-LABEL: @bar(
15 // CHECK: call void @llvm.memcpy.p0i8.p0i8
16 __builtin_memcpy(P, Q, sizeof(struct x));
17 }
18