summaryrefslogtreecommitdiffstats
path: root/test/PCH/uses-seh.cpp
blob: 6fbfc9766c48840072c8fdfc49f6fbe4391b17ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Make SEH works in PCH
//
// Test this without pch.
// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include %s -emit-llvm -o - %s | FileCheck %s

// Test with pch.
// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include-pch %t -emit-llvm -o - %s | FileCheck %s

#ifndef HEADER
#define HEADER

int shouldCatch();
inline int f() {
  __try {
  } __except (shouldCatch()) {
  }
  return 0;
}
int x = f();

// CHECK: define linkonce_odr i32 @"\01?f@@YAHXZ"()
// CHECK: define internal i32 @"\01?filt$0@0@f@@"({{.*}})

#else

// empty

#endif