diff options
Diffstat (limited to 'test/CodeGenCXX/new.cpp')
-rw-r--r-- | test/CodeGenCXX/new.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGenCXX/new.cpp b/test/CodeGenCXX/new.cpp index 3a72bb84..8d9f641 100644 --- a/test/CodeGenCXX/new.cpp +++ b/test/CodeGenCXX/new.cpp @@ -231,3 +231,22 @@ namespace PR10197 { template void f<int>(); } + +namespace PR11523 { + class MyClass; + typedef int MyClass::* NewTy; + // CHECK: define i64* @_ZN7PR115231fEv + // CHECK: store i64 -1 + NewTy* f() { return new NewTy[2](); } +} + +namespace PR11757 { + // Make sure we elide the copy construction. + struct X { X(); X(const X&); }; + X* a(X* x) { return new X(X()); } + // CHECK: define {{.*}} @_ZN7PR117571aEPNS_1XE + // CHECK: [[CALL:%.*]] = call noalias i8* @_Znwm + // CHECK-NEXT: [[CASTED:%.*]] = bitcast i8* [[CALL]] to + // CHECK-NEXT: call void @_ZN7PR117571XC1Ev({{.*}}* [[CASTED]]) + // CHECK-NEXT: ret {{.*}} [[CASTED]] +} |