aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/exception-spec-decay.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-28 22:33:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-28 22:33:28 +0000
commit21173b1080abaa2738f9e700a9d4b0d04f928930 (patch)
tree9799d98307a5cce41be90fcbfa8a08154cc8ee97 /test/CodeGenCXX/exception-spec-decay.cpp
parent060f34d6d12a851faa9463da522f7dff1104d0e1 (diff)
PR14388: An array or function type in an exception specification should be
decayed to a pointer type. Patch by WenHan Gu, with a little tweaking and additional testcases by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/exception-spec-decay.cpp')
-rw-r--r--test/CodeGenCXX/exception-spec-decay.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/CodeGenCXX/exception-spec-decay.cpp b/test/CodeGenCXX/exception-spec-decay.cpp
new file mode 100644
index 0000000000..4928353907
--- /dev/null
+++ b/test/CodeGenCXX/exception-spec-decay.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions %s -triple=i686-unknown-linux -emit-llvm -o - | FileCheck %s
+typedef int Array[10];
+
+void foo() throw (Array) {
+ throw 0;
+ // CHECK: landingpad
+ // CHECK-NEXT: filter {{.*}} @_ZTIPi
+}
+
+struct S {
+ void foo() throw (S[10]) {
+ throw 0;
+ }
+};
+
+template <typename T>
+struct S2 {
+ void foo() throw (T) {
+ throw 0;
+ }
+};
+
+int main() {
+ S s;
+ s.foo();
+ // CHECK: landingpad
+ // CHECK-NEXT: filter {{.*}} @_ZTIP1S
+
+ S2 <int[10]> s2;
+ s2.foo();
+ // CHECK: landingpad
+ // CHECK-NEXT: filter {{.*}} @_ZTIPi
+}