2011-02-28 08:40:07 +08:00
|
|
|
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm-only -verify %s -Wno-unreachable-code
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2009-12-08 04:25:53 +08:00
|
|
|
|
|
|
|
int val = 42;
|
|
|
|
int& test1() {
|
|
|
|
return throw val, val;
|
|
|
|
}
|
|
|
|
|
|
|
|
int test2() {
|
|
|
|
return val ? throw val : val;
|
|
|
|
}
|
2010-10-29 16:14:02 +08:00
|
|
|
|
|
|
|
// rdar://problem/8608801
|
|
|
|
void test3() {
|
|
|
|
throw false;
|
|
|
|
}
|
2011-10-15 10:10:40 +08:00
|
|
|
|
|
|
|
// PR10582
|
|
|
|
int test4() {
|
|
|
|
return 1 ? throw val : val;
|
|
|
|
}
|