Rafael Espindola | f0adba9 | 2011-04-15 15:11:06 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -o - | FileCheck %s |
| 2 | |
Rafael Espindola | f0adba9 | 2011-04-15 15:11:06 +0000 | [diff] [blame] | 3 | ; CHECK: .cfi_personality 0, __gnat_eh_personality |
Rafael Espindola | 7b11a4c | 2011-04-29 14:48:51 +0000 | [diff] [blame] | 4 | ; CHECK: .cfi_lsda 0, .Lexception0 |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 5 | |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 6 | @error = external global i8 |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 7 | |
| 8 | define void @_ada_x() { |
| 9 | entry: |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 10 | invoke void @raise() |
| 11 | to label %eh_then unwind label %unwind |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 12 | |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 13 | unwind: ; preds = %entry |
| 14 | %eh_ptr = tail call i8* @llvm.eh.exception() |
| 15 | %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i8* @error) |
| 16 | %eh_typeid = tail call i32 @llvm.eh.typeid.for(i8* @error) |
| 17 | %tmp2 = icmp eq i32 %eh_select, %eh_typeid |
| 18 | br i1 %tmp2, label %eh_then, label %Unwind |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 19 | |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 20 | eh_then: ; preds = %unwind, %entry |
| 21 | ret void |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 22 | |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 23 | Unwind: ; preds = %unwind |
| 24 | %0 = tail call i32 (...)* @_Unwind_Resume(i8* %eh_ptr) |
| 25 | unreachable |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | declare void @raise() |
| 29 | |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 30 | declare i8* @llvm.eh.exception() nounwind readonly |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 31 | |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 32 | declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 33 | |
Chris Lattner | b85e4eb | 2011-06-18 06:05:24 +0000 | [diff] [blame] | 34 | declare i32 @llvm.eh.typeid.for(i8*) nounwind |
Duncan Sands | 9426caa | 2007-05-05 20:22:08 +0000 | [diff] [blame] | 35 | |
| 36 | declare i32 @__gnat_eh_personality(...) |
| 37 | |
| 38 | declare i32 @_Unwind_Resume(...) |