Anton Korobeynikov | 9184b25 | 2010-02-15 22:35:59 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -enable-eh -o - | grep zPL |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 2 | |
| 3 | @error = external global i8 ; <i8*> [#uses=2] |
| 4 | |
| 5 | define void @_ada_x() { |
| 6 | entry: |
| 7 | invoke void @raise( ) |
| 8 | to label %eh_then unwind label %unwind |
| 9 | |
| 10 | unwind: ; preds = %entry |
| 11 | %eh_ptr = tail call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2] |
Anton Korobeynikov | 8806c7b | 2007-09-07 11:39:35 +0000 | [diff] [blame] | 12 | %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i8* @error ) ; <i32> [#uses=1] |
| 13 | %eh_typeid = tail call i32 @llvm.eh.typeid.for.i32( i8* @error ) ; <i32> [#uses=1] |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 14 | %tmp2 = icmp eq i32 %eh_select, %eh_typeid ; <i1> [#uses=1] |
| 15 | br i1 %tmp2, label %eh_then, label %Unwind |
| 16 | |
| 17 | eh_then: ; preds = %unwind, %entry |
| 18 | ret void |
| 19 | |
| 20 | Unwind: ; preds = %unwind |
| 21 | tail call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; <i32>:0 [#uses=0] |
| 22 | unreachable |
| 23 | } |
| 24 | |
| 25 | declare void @raise() |
| 26 | |
| 27 | declare i8* @llvm.eh.exception() |
| 28 | |
Anton Korobeynikov | 8806c7b | 2007-09-07 11:39:35 +0000 | [diff] [blame] | 29 | declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 30 | |
Anton Korobeynikov | 8806c7b | 2007-09-07 11:39:35 +0000 | [diff] [blame] | 31 | declare i32 @llvm.eh.typeid.for.i32(i8*) |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 32 | |
| 33 | declare i32 @__gnat_eh_personality(...) |
| 34 | |
| 35 | declare i32 @_Unwind_Resume(...) |