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 | cd5855e3549eebbf2a22d31b37f36d223c4c7b62 (patch) | |
tree | 2e2885e4d9f404f48923f7d0f87ded7ff0c4490a /clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp | |
parent | 387fccd8dad1ab16f4d7332e8462b88bcbb2b26e (diff) | |
download | bcm5719-llvm-cd5855e3549eebbf2a22d31b37f36d223c4c7b62.tar.gz bcm5719-llvm-cd5855e3549eebbf2a22d31b37f36d223c4c7b62.zip |
[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.
llvm-svn: 262198
Diffstat (limited to 'clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp b/clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp index 423c1b74cc2..c660d145393 100644 --- a/clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp +++ b/clang/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"( |