diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-03-15 18:42:48 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-03-15 18:42:48 +0000 |
commit | a968e97947b1281c3bb3c4d47a952b3801d9bb02 (patch) | |
tree | d886fda11eb0116f3364b00504e10ffbd0ef720e /test | |
parent | 4eb7f69515c059c64e87ed32cdbeb743ec6ec03d (diff) | |
download | clang-a968e97947b1281c3bb3c4d47a952b3801d9bb02.tar.gz |
Reintroduce r127617: "Code generation for noexcept." with fixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127685 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CXX/except/except.spec/p9-dynamic.cpp | 11 | ||||
-rw-r--r-- | test/CXX/except/except.spec/p9-noexcept.cpp | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/CXX/except/except.spec/p9-dynamic.cpp b/test/CXX/except/except.spec/p9-dynamic.cpp new file mode 100644 index 0000000000..490d2fa21f --- /dev/null +++ b/test/CXX/except/except.spec/p9-dynamic.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s + +void external(); + +void target() throw(int) +{ + // CHECK: invoke void @_Z8externalv() + external(); +} +// CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector({{.*}} i8* bitcast (i8** @_ZTIi to i8*), i8* null) nounwind +// CHECK: call void @__cxa_call_unexpected diff --git a/test/CXX/except/except.spec/p9-noexcept.cpp b/test/CXX/except/except.spec/p9-noexcept.cpp new file mode 100644 index 0000000000..76ac66c841 --- /dev/null +++ b/test/CXX/except/except.spec/p9-noexcept.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 %s -std=c++0x -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s + +void external(); + +void target() noexcept +{ + // CHECK: invoke void @_Z8externalv() + external(); +} +// CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector({{.*}} i8* null) nounwind +// CHECK-NEXT: call void @_ZSt9terminatev() noreturn nounwind +// CHECK-NEXT: unreachable + +void reverse() noexcept(false) +{ + // CHECK: call void @_Z8externalv() + external(); +} |