Clang Project

clang_source_code/test/PCH/uses-seh.cpp
1// Make SEH works in PCH
2//
3// Test this without pch.
4// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include %s -emit-llvm -o - %s | FileCheck %s
5
6// Test with pch.
7// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -emit-pch -o %t %s
8// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include-pch %t -emit-llvm -o - %s | FileCheck %s
9
10#ifndef HEADER
11#define HEADER
12
13int shouldCatch();
14inline int f() {
15  __try {
16  } __except (shouldCatch()) {
17  }
18  return 0;
19}
20int x = f();
21
22// CHECK: define linkonce_odr dso_local i32 @"?f@@YAHXZ"()
23// CHECK: define internal i32 @"?filt$0@0@f@@"({{.*}})
24
25#else
26
27// empty
28
29#endif
30