diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-02-29 01:40:36 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-02-29 01:40:36 +0000 |
commit | ef1d726359c15e390de5086e9f381e80076b7a45 (patch) | |
tree | c4feeb5351779f0e0ef8891507ec69955a393201 /test/CodeGenCXX/exceptions-cxx-ehsc.cpp | |
parent | 9f3d3102069a4a9ded5a405b8007f7a0393b9fd9 (diff) |
[clang-cl] /EHc should not effect functions with explicit exception specifications
Functions with an explicit exception specification have their behavior
dictated by the specification. The additional /EHc behavior only comes
into play if no exception specification is given.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/exceptions-cxx-ehsc.cpp')
-rw-r--r-- | test/CodeGenCXX/exceptions-cxx-ehsc.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGenCXX/exceptions-cxx-ehsc.cpp b/test/CodeGenCXX/exceptions-cxx-ehsc.cpp index 423c1b74cc..c660d14539 100644 --- a/test/CodeGenCXX/exceptions-cxx-ehsc.cpp +++ b/test/CodeGenCXX/exceptions-cxx-ehsc.cpp @@ -14,3 +14,18 @@ void caller() { // CHECK-LABEL: define void @"\01?caller@test1@@YAXXZ"( // CHECK: call void @never_throws( // CHECK: invoke void @"\01?may_throw@test1@@YAXXZ"( + +namespace test2 { +struct Cleanup { ~Cleanup(); }; +extern "C" void throws_int() throw(int); +void may_throw(); + +void caller() { + Cleanup x; + throws_int(); + may_throw(); +} +} +// CHECK-LABEL: define void @"\01?caller@test2@@YAXXZ"( +// CHECK: invoke void @throws_int( +// CHECK: invoke void @"\01?may_throw@test2@@YAXXZ"( |