aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/throw-expressions.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-07 20:25:53 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-07 20:25:53 +0000
commit48daf59c9f52856ca80074f1f5a30aa29c235726 (patch)
tree59b0396f74adb90383575f6d45b21947eeade432 /test/CodeGenCXX/throw-expressions.cpp
parent130c69e969a785ff3be9e909f8eba7f89e42ac10 (diff)
Correctly handle conditional operators involving throw.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/throw-expressions.cpp')
-rw-r--r--test/CodeGenCXX/throw-expressions.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGenCXX/throw-expressions.cpp b/test/CodeGenCXX/throw-expressions.cpp
new file mode 100644
index 0000000000..7fe556312b
--- /dev/null
+++ b/test/CodeGenCXX/throw-expressions.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc -emit-llvm-only -verify %s
+
+int val = 42;
+int& test1() {
+ return throw val, val;
+}
+
+int test2() {
+ return val ? throw val : val;
+}