diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/CodeGenCXX/exceptions.cpp | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'test/CodeGenCXX/exceptions.cpp')
-rw-r--r-- | test/CodeGenCXX/exceptions.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/CodeGenCXX/exceptions.cpp b/test/CodeGenCXX/exceptions.cpp index e8f6c79..ff76b11 100644 --- a/test/CodeGenCXX/exceptions.cpp +++ b/test/CodeGenCXX/exceptions.cpp @@ -1,6 +1,9 @@ // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s -typedef typeof(sizeof(0)) size_t; +typedef __typeof(sizeof(0)) size_t; + +// Declare the reserved global placement new. +void *operator new(size_t, void*); // This just shouldn't crash. namespace test0 { @@ -526,4 +529,21 @@ namespace test11 { // (After this is a terminate landingpad.) } +namespace test12 { + struct A { + void operator delete(void *, void *); + A(); + }; + + A *test(void *ptr) { + return new (ptr) A(); + } + // CHECK-LABEL: define {{.*}} @_ZN6test124testEPv( + // CHECK: [[PTR:%.*]] = load i8*, i8* + // CHECK-NEXT: [[CAST:%.*]] = bitcast i8* [[PTR]] to [[A:%.*]]* + // CHECK-NEXT: invoke void @_ZN6test121AC1Ev([[A]]* [[CAST]]) + // CHECK: ret [[A]]* [[CAST]] + // CHECK: invoke void @_ZN6test121AdlEPvS1_(i8* [[PTR]], i8* [[PTR]]) +} + // CHECK: attributes [[NI_NR_NUW]] = { noinline noreturn nounwind } |