]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGenCXX/mingw-w64-seh-exceptions.cpp
Vendor import of clang 3.9.0 release r280324:
[FreeBSD/FreeBSD.git] / test / CodeGenCXX / mingw-w64-seh-exceptions.cpp
1 // RUN: %clang_cc1 %s -fexceptions -emit-llvm -triple x86_64-w64-windows-gnu -o - | FileCheck %s --check-prefix=X64
2 // RUN: %clang_cc1 %s -fexceptions -emit-llvm -triple i686-w64-windows-gnu -o - | FileCheck %s --check-prefix=X86
3
4 extern "C" void foo();
5 extern "C" void bar();
6
7 struct Cleanup {
8   ~Cleanup() {
9     bar();
10   }
11 };
12
13 extern "C" void test() {
14   Cleanup x;
15   foo();
16 }
17
18 // X64: define void @test()
19 // X64-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*)
20 // X64: invoke void @foo()
21 // X64: landingpad { i8*, i32 }
22
23 // X86: define void @test()
24 // X86-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
25 // X86: invoke void @foo()
26 // X86: landingpad { i8*, i32 }