xref: /llvm-project/clang/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp (revision 1b9a6e58a8b831193c9e5e733f881aabe0d2d06b)
1 // RUN: %clang_cc1 %s -fexceptions -exception-model=seh -emit-llvm -triple x86_64-w64-windows-gnu -o - | FileCheck %s --check-prefix=X64
2 // RUN: %clang_cc1 %s -fexceptions -exception-model=dwarf -emit-llvm -triple i686-w64-windows-gnu -o - | FileCheck %s --check-prefix=X86
3 // RUN: %clang_cc1 %s -fexceptions -emit-llvm -triple i686-w64-windows-gnu -o - | FileCheck %s --check-prefix=X86
4 
5 extern "C" void foo();
6 extern "C" void bar();
7 
8 struct Cleanup {
~CleanupCleanup9   ~Cleanup() {
10     bar();
11   }
12 };
13 
test()14 extern "C" void test() {
15   Cleanup x;
16   foo();
17 }
18 
19 // X64: define dso_local void @test()
20 // X64-SAME: personality ptr @__gxx_personality_seh0
21 // X64: invoke void @foo()
22 // X64: landingpad { ptr, i32 }
23 
24 // X86: define dso_local void @test()
25 // X86-SAME: personality ptr @__gxx_personality_v0
26 // X86: invoke void @foo()
27 // X86: landingpad { ptr, i32 }
28