summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/implicit-allocation-functions.cpp
diff options
context:
space:
mode:
authorLarisse Voufo <lvoufo@google.com>2015-02-22 06:36:53 +0000
committerLarisse Voufo <lvoufo@google.com>2015-02-22 06:36:53 +0000
commita65298af650dd10cc8fa439e46d1a1ec4d1e5555 (patch)
treef85a90bb1c937285fa2ae64215abe3264f723d11 /clang/test/CodeGenCXX/implicit-allocation-functions.cpp
parent01c97c08608f9e676f73439145b2e8a9552f0369 (diff)
downloadbcm5719-llvm-a65298af650dd10cc8fa439e46d1a1ec4d1e5555.tar.gz
bcm5719-llvm-a65298af650dd10cc8fa439e46d1a1ec4d1e5555.zip
Relax the requirement on sized deallocation a bit: Default on unsized delete if sized delete is not provided in global scope, and -fdefine-sized-deallocation option is disabled.
llvm-svn: 230160
Diffstat (limited to 'clang/test/CodeGenCXX/implicit-allocation-functions.cpp')
-rw-r--r--clang/test/CodeGenCXX/implicit-allocation-functions.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/clang/test/CodeGenCXX/implicit-allocation-functions.cpp b/clang/test/CodeGenCXX/implicit-allocation-functions.cpp
index 3bac6b9c572..d4e9841c1c6 100644
--- a/clang/test/CodeGenCXX/implicit-allocation-functions.cpp
+++ b/clang/test/CodeGenCXX/implicit-allocation-functions.cpp
@@ -1,15 +1,20 @@
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++11 %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK11
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++11 -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK11
-// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -fno-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK11
-// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14UND
-// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK14 -check-prefix=CHECK14UND
-// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -fdefine-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14DEFCOMDAT
-// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -fdefine-sized-deallocation -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK14 -check-prefix=CHECK14DEFCOMDAT
-// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-macosx -o - -std=c++14 -fdefine-sized-deallocation %s | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14DEFNOCOMDAT
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fno-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK11
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14UND
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK14 -check-prefix=CHECK14UND
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fdefine-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14DEFCOMDAT
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fdefine-sized-deallocation -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK14 -check-prefix=CHECK14DEFCOMDAT
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-macosx -o - -std=c++14 -DINLIB -fdefine-sized-deallocation %s | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14DEFNOCOMDAT
// PR22419: Implicit sized deallocation functions always have default visibility.
// Generalized to all implicit allocation functions.
+#ifdef INLIB
+typedef decltype(sizeof(0)) size_t;
+void operator delete(void *, size_t) noexcept;
+void operator delete[](void *, size_t) noexcept;
+#endif
// CHECK14-DAG: %struct.A = type { i8 }
struct A { };
OpenPOWER on IntegriCloud