summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/byval-memcpy-elim.c
blob: 8aa08fb07b2cee5fb75c646e95c8c2dcea4e3981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10 < %s | FileCheck %s

struct Test1S {
 long NumDecls;
 long X;
 long Y;
};
struct Test2S {
 long NumDecls;
 long X;
};

// Make sure we don't generate extra memcpy for lvalues
void test1a(struct Test1S, struct Test2S);
// CHECK: define void @test1(
// CHECK-NOT: memcpy
// CHECK: call void @test1a
void test1(struct Test1S *A, struct Test2S *B) {
  test1a(*A, *B);
}
OpenPOWER on IntegriCloud