Home | History | Annotate | Download | only in compiler-flags
      1 // Copyright (c) 2012 Google Inc. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include <excpt.h>
      6 #include <stdlib.h>
      7 
      8 void fail() {
      9    try {
     10       int i = 0, j = 1;
     11       j /= i;
     12    } catch(...) {
     13      exit(1);
     14    }
     15 }
     16 
     17 int main() {
     18    __try {
     19       fail();
     20    } __except(EXCEPTION_EXECUTE_HANDLER) {
     21      return 2;
     22    }
     23    return 3;
     24 }
     25