xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/exceptions-seh.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1 // RUN: not %clang_cc1 -triple i686-pc-win32 -fexceptions -fms-extensions -emit-llvm -o - %s 2>&1 | FileCheck %s
2 
3 // This is a codegen test because we only emit the diagnostic when we start
4 // generating code.
5 
SaveDiv(int numerator,int denominator,int * res)6 int SaveDiv(int numerator, int denominator, int *res) {
7   int myres = 0;
8   __try {
9     myres = numerator / denominator;
10     __leave;
11   } __except (1) {
12     return 0;
13   }
14   *res = myres;
15   return 1;
16 }
17 // CHECK-NOT: error:
18 // CHECK: error: cannot compile this SEH __try yet
19 // CHECK-NOT: error:
20