summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/throw-expression-cleanup.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-08-02 00:10:24 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-08-02 00:10:24 +0000
commitabab77603967c1284ffde3c37165a81dcd0cbea9 (patch)
tree028aed6a6537c9d8d723dadb372556419c5d0c01 /clang/test/CodeGenCXX/throw-expression-cleanup.cpp
parenta766b4746ddad780dbee9516ebb1fb908fd88041 (diff)
downloadbcm5719-llvm-abab77603967c1284ffde3c37165a81dcd0cbea9.tar.gz
bcm5719-llvm-abab77603967c1284ffde3c37165a81dcd0cbea9.zip
Make sure we don't emit IR for unused EH cleanups. PR13359.
llvm-svn: 161148
Diffstat (limited to 'clang/test/CodeGenCXX/throw-expression-cleanup.cpp')
-rw-r--r--clang/test/CodeGenCXX/throw-expression-cleanup.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/throw-expression-cleanup.cpp b/clang/test/CodeGenCXX/throw-expression-cleanup.cpp
new file mode 100644
index 00000000000..0c41bc65bc3
--- /dev/null
+++ b/clang/test/CodeGenCXX/throw-expression-cleanup.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 %s -emit-llvm -fcxx-exceptions -fexceptions -std=c++11 -o - | FileCheck %s
+// PR13359
+
+struct X {
+ ~X();
+};
+struct Error {
+ Error(const X&) noexcept;
+};
+
+void f() {
+ try {
+ throw Error(X());
+ } catch (...) { }
+}
+
+// CHECK: define void @_Z1fv
+// CHECK: call void @_ZN5ErrorC1ERK1X
+// CHECK: invoke void @__cxa_throw
+// CHECK: landingpad
+// CHECK: call void @_ZN1XD1Ev
+// CHECK-NOT: __cxa_free_exception
OpenPOWER on IntegriCloud