summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/exceptions-seh-leave.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/exceptions-seh-leave.c')
-rw-r--r--clang/test/CodeGen/exceptions-seh-leave.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGen/exceptions-seh-leave.c b/clang/test/CodeGen/exceptions-seh-leave.c
new file mode 100644
index 00000000000..86161f297e4
--- /dev/null
+++ b/clang/test/CodeGen/exceptions-seh-leave.c
@@ -0,0 +1,19 @@
+// RUN: not %clang_cc1 -triple x86_64-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;
+ __leave;
+ } __except (1) {
+ return 0;
+ }
+ *res = myres;
+ return 1;
+}
+// CHECK-NOT: error:
+// CHECK: error: cannot compile this SEH __leave yet
+// CHECK-NOT: error:
OpenPOWER on IntegriCloud