summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/exceptions-seh.c
blob: f7d24bd3093f506795a0d5280a157ca59b4bd969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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