Anders Carlsson | abea951 | 2011-02-28 00:40:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm-only -verify %s -Wno-unreachable-code |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Eli Friedman | 48daf59 | 2009-12-07 20:25:53 +0000 | [diff] [blame] | 3 | |
| 4 | int val = 42; |
| 5 | int& test1() { |
| 6 | return throw val, val; |
| 7 | } |
| 8 | |
| 9 | int test2() { |
| 10 | return val ? throw val : val; |
| 11 | } |
John McCall | 14e1bc9 | 2010-10-29 08:14:02 +0000 | [diff] [blame] | 12 | |
| 13 | // rdar://problem/8608801 |
| 14 | void test3() { |
| 15 | throw false; |
| 16 | } |
Eli Friedman | c8645e3 | 2011-10-15 02:10:40 +0000 | [diff] [blame] | 17 | |
| 18 | // PR10582 |
| 19 | int test4() { |
| 20 | return 1 ? throw val : val; |
| 21 | } |