// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10 < %s | FileCheck %s
;
;
// Make sure we don't generate extra memcpy for lvalues
void ;
// CHECK-LABEL: define{{.*}} void @test1(
// CHECK-NOT: memcpy
// CHECK: call void @test1a
void
// The above gets tricker when the byval argument requires higher alignment
// than the natural alignment of the type in question.
// rdar://9483886
// Make sure we do generate a memcpy when we cannot guarantee alignment.
;
void ;
// CHECK-LABEL: define{{.*}} void @test2(
// CHECK: alloca %struct.Test3S, align 8
// CHECK: memcpy
// CHECK: call void @test2a
void
// But make sure we don't generate a memcpy when we can guarantee alignment.
void ;
// CHECK-LABEL: define{{.*}} void @test3(
// CHECK: alloca %struct.Test3S, align 8
// CHECK: call void @fooey
// CHECK-NOT: memcpy
// CHECK: call void @test2a
// CHECK-NOT: memcpy
// CHECK: call void @test2a
void