diff options
Diffstat (limited to 'test/CodeGenCXX/nrvo.cpp')
-rw-r--r-- | test/CodeGenCXX/nrvo.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGenCXX/nrvo.cpp b/test/CodeGenCXX/nrvo.cpp index 8d19b1e..d03b21bac 100644 --- a/test/CodeGenCXX/nrvo.cpp +++ b/test/CodeGenCXX/nrvo.cpp @@ -131,3 +131,18 @@ X test4(bool B) { // CHECK: tail call void @exit(i32 1) exit(1); } + +#ifdef __EXCEPTIONS +// CHECK-EH: define void @_Z5test5 +void may_throw(); +X test5() { + try { + may_throw(); + } catch (X x) { + // CHECK-EH: invoke void @_ZN1XC1ERKS_ + // CHECK-EH: call void @__cxa_end_catch() + // CHECK-EH: ret void + return x; + } +} +#endif |