diff options
Diffstat (limited to 'clang/test/CodeGenCXX/throw-expressions.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/throw-expressions.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/throw-expressions.cpp b/clang/test/CodeGenCXX/throw-expressions.cpp index ba8a86881a6..87c481b25fe 100644 --- a/clang/test/CodeGenCXX/throw-expressions.cpp +++ b/clang/test/CodeGenCXX/throw-expressions.cpp @@ -43,3 +43,27 @@ int test5(bool x, bool y, int z) { // // end: // CHECK: ret i32 + +int test6(bool x, bool y, int z) { + return (x ? throw 1 : y) ? z : (throw 2); +} +// CHECK: define i32 @_Z5test6bbi( +// CHECK: br i1 +// +// x.true: +// CHECK: call void @__cxa_throw( +// CHECK-NEXT: unreachable +// +// x.false: +// CHECK: br i1 +// +// y.true: +// CHECK: load i32* +// CHECK: br label +// +// y.false: +// CHECK: call void @__cxa_throw( +// CHECK-NEXT: unreachable +// +// end: +// CHECK: ret i32 |