1 /// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -o - -std=c++11 %s -DPOD | FileCheck %s -check-prefix=CHECK-POD
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -o - -std=c++11 %s | FileCheck %s -check-prefix=CHECK-NONPOD
4 // Declare the reserved placement operators.
5 typedef __typeof__(sizeof(0)) size_t;
6 void *operator new(size_t, void*) throw();
7 void operator delete(void*, void*) throw();
8 void *operator new[](size_t, void*) throw();
9 void operator delete[](void*, void*) throw();
10 template<typename T
> T
&&move(T
&);
20 // It is not legal to copy the tail padding in all cases, but if it is it can
21 // yield better codegen.
23 foo
*test1(void *f
, const foo
&x
) {
24 return new (f
) foo(x
);
26 // CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24
28 // CHECK-NONPOD: test1
29 // CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24
32 foo
*test2(const foo
&x
) {
35 // CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24
37 // CHECK-NONPOD: test2
38 // CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24
41 foo
test3(const foo
&x
) {
45 // CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24
47 // CHECK-NONPOD: test3
48 // CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24
54 // CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24
56 // CHECK-NONPOD: test4
57 // CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24
60 void test5(foo
&f
, const foo
&x
) {
63 // CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24
65 // CHECK-NONPOD: test5
66 // CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 17
74 // CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24
76 // CHECK-NONPOD: test6
77 // CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 17
82 void test7(const foo
&x
) {
85 // CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24
87 // CHECK-NONPOD: test7
88 // CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24