summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/exceptions-seh.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/CodeGen/exceptions-seh.c
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/CodeGen/exceptions-seh.c')
-rw-r--r--test/CodeGen/exceptions-seh.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/exceptions-seh.c b/test/CodeGen/exceptions-seh.c
new file mode 100644
index 0000000..eadbe15
--- /dev/null
+++ b/test/CodeGen/exceptions-seh.c
@@ -0,0 +1,18 @@
+// RUN: not %clang_cc1 -triple i686-pc-win32 -fexceptions -fms-extensions -emit-llvm -o - %s 2>&1 | FileCheck %s
+
+// This is a codegen test because we only emit the diagnostic when we start
+// generating code.
+
+int SaveDiv(int numerator, int denominator, int *res) {
+ int myres = 0;
+ __try {
+ myres = numerator / denominator;
+ } __except (1) {
+ return 0;
+ }
+ *res = myres;
+ return 1;
+}
+// CHECK-NOT error
+// CHECK: error: cannot compile this SEH __try yet
+// CHECK-NOT error
OpenPOWER on IntegriCloud