blob: f04185b23f1b91d08d8ee5443aa5b9dafaece029 [file] [log] [blame]
Anders Carlssonabea9512011-02-28 00:40:07 +00001// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm-only -verify %s -Wno-unreachable-code
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Eli Friedman48daf592009-12-07 20:25:53 +00003
4int val = 42;
5int& test1() {
6 return throw val, val;
7}
8
9int test2() {
10 return val ? throw val : val;
11}
John McCall14e1bc92010-10-29 08:14:02 +000012
13// rdar://problem/8608801
14void test3() {
15 throw false;
16}
Eli Friedmanc8645e32011-10-15 02:10:40 +000017
18// PR10582
19int test4() {
20 return 1 ? throw val : val;
21}