xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -fexceptions -emit-llvm -triple x86_64-w64-windows-gnu -o - | FileCheck %s --check-prefix=X64
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -fexceptions -emit-llvm -triple i686-w64-windows-gnu -o - | FileCheck %s --check-prefix=X86
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc extern "C" void foo();
5*0a6a1f1dSLionel Sambuc extern "C" void bar();
6*0a6a1f1dSLionel Sambuc 
7*0a6a1f1dSLionel Sambuc struct Cleanup {
~CleanupCleanup8*0a6a1f1dSLionel Sambuc   ~Cleanup() {
9*0a6a1f1dSLionel Sambuc     bar();
10*0a6a1f1dSLionel Sambuc   }
11*0a6a1f1dSLionel Sambuc };
12*0a6a1f1dSLionel Sambuc 
test()13*0a6a1f1dSLionel Sambuc extern "C" void test() {
14*0a6a1f1dSLionel Sambuc   Cleanup x;
15*0a6a1f1dSLionel Sambuc   foo();
16*0a6a1f1dSLionel Sambuc }
17*0a6a1f1dSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc // X64: define void @test()
19*0a6a1f1dSLionel Sambuc // X64: invoke void @foo()
20*0a6a1f1dSLionel Sambuc // X64: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*)
21*0a6a1f1dSLionel Sambuc 
22*0a6a1f1dSLionel Sambuc // X86: define void @test()
23*0a6a1f1dSLionel Sambuc // X86: invoke void @foo()
24*0a6a1f1dSLionel Sambuc // X86: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
25