Two updated tests for MinGW 32 and 64 exception handling code generation.
[oota-llvm.git] / test / CodeGen / X86 / 2007-05-05-Personality.ll
1 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -o -     | FileCheck %s  --check-prefix=LIN
2 ; RUN: llc < %s -mtriple=x86_64-pc-windows-gnu -o - | FileCheck %s  --check-prefix=LIN
3 ; RUN: llc < %s -mtriple=i386-pc-mingw32 -o -       | FileCheck %s  --check-prefix=WIN
4 ; RUN: llc < %s -mtriple=i686-pc-windows-gnu -o -   | FileCheck %s  --check-prefix=WIN
5
6 ; LIN: .cfi_personality 0, __gnat_eh_personality
7 ; LIN: .cfi_lsda 0, .Lexception0
8 ; WIN: .cfi_personality 0, ___gnat_eh_personality
9 ; WIN: .cfi_lsda 0, Lexception0
10
11 @error = external global i8
12
13 define void @_ada_x() {
14 entry:
15   invoke void @raise()
16           to label %eh_then unwind label %unwind
17
18 unwind:                                           ; preds = %entry 
19   %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*)
20               catch i8* @error
21   %eh_select = extractvalue { i8*, i32 } %eh_ptr, 1
22   %eh_typeid = tail call i32 @llvm.eh.typeid.for(i8* @error)
23   %tmp2 = icmp eq i32 %eh_select, %eh_typeid
24   br i1 %tmp2, label %eh_then, label %Unwind
25
26 eh_then:                                          ; preds = %unwind, %entry
27   ret void
28
29 Unwind:                                           ; preds = %unwind
30   resume { i8*, i32 } %eh_ptr
31 }
32
33 declare void @raise()
34
35 declare i32 @llvm.eh.typeid.for(i8*) nounwind
36
37 declare i32 @__gnat_eh_personality(...)
38
39 declare i32 @_Unwind_Resume(...)