Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / struct-copy.c
blobbb4166c9464ffd7bb1c0f1843eb96f64a5f7e3bf
1 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
2 struct x { int a[100]; };
5 void foo(struct x *P, struct x *Q) {
6 // CHECK-LABEL: @foo(
7 // CHECK: call void @llvm.memcpy.p0.p0
8 *P = *Q;
11 // CHECK: declare void @llvm.memcpy.p0.p0{{.*}}(ptr noalias nocapture writeonly, ptr noalias nocapture readonly
13 void bar(struct x *P, struct x *Q) {
14 // CHECK-LABEL: @bar(
15 // CHECK: call void @llvm.memcpy.p0.p0
16 __builtin_memcpy(P, Q, sizeof(struct x));