Logan Chien | ba1b695 | 2014-05-14 16:37:32 +0000 | [diff] [blame] | 1 | ; ARM EHABI test for the handlerdata. |
| 2 | |
| 3 | ; This test case checks whether the handlerdata for exception |
| 4 | ; handling is generated properly. |
| 5 | ; |
| 6 | ; (1) The handlerdata must not be empty. |
| 7 | ; (2) LPStartEncoding == DW_EH_PE_omit |
| 8 | ; (3) TTypeEncoding == DW_EH_PE_absptr |
| 9 | ; (4) CallSiteEncoding == DW_EH_PE_udata4 |
| 10 | |
| 11 | ; RUN: llc -mtriple arm-unknown-linux-gnueabi -filetype=asm -o - %s \ |
| 12 | ; RUN: | FileCheck %s |
| 13 | |
| 14 | ; RUN: llc -mtriple arm-unknown-linux-gnueabi -filetype=asm -o - %s \ |
| 15 | ; RUN: -relocation-model=pic \ |
| 16 | ; RUN: | FileCheck %s |
| 17 | |
| 18 | declare void @throw_exception() |
| 19 | |
| 20 | declare i32 @__gxx_personality_v0(...) |
| 21 | |
| 22 | declare i8* @__cxa_begin_catch(i8*) |
| 23 | |
| 24 | declare void @__cxa_end_catch() |
| 25 | |
David Majnemer | 7fddecc | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 26 | define void @test1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { |
Logan Chien | ba1b695 | 2014-05-14 16:37:32 +0000 | [diff] [blame] | 27 | entry: |
| 28 | invoke void @throw_exception() to label %try.cont unwind label %lpad |
| 29 | |
| 30 | lpad: |
David Majnemer | 7fddecc | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 31 | %0 = landingpad { i8*, i32 } |
Logan Chien | ba1b695 | 2014-05-14 16:37:32 +0000 | [diff] [blame] | 32 | catch i8* null |
| 33 | %1 = extractvalue { i8*, i32 } %0, 0 |
| 34 | %2 = tail call i8* @__cxa_begin_catch(i8* %1) |
| 35 | tail call void @__cxa_end_catch() |
| 36 | br label %try.cont |
| 37 | |
| 38 | try.cont: |
| 39 | ret void |
| 40 | } |
| 41 | |
| 42 | ; CHECK: .globl test1 |
Dan Gohman | 61d15ae | 2016-01-26 00:03:25 +0000 | [diff] [blame] | 43 | ; CHECK: .p2align 2 |
Logan Chien | ba1b695 | 2014-05-14 16:37:32 +0000 | [diff] [blame] | 44 | ; CHECK: .type test1,%function |
| 45 | ; CHECK-LABEL: test1: |
| 46 | ; CHECK: .fnstart |
| 47 | ; CHECK: .personality __gxx_personality_v0 |
| 48 | ; CHECK: .handlerdata |
Dan Gohman | 61d15ae | 2016-01-26 00:03:25 +0000 | [diff] [blame] | 49 | ; CHECK: .p2align 2 |
Logan Chien | ba1b695 | 2014-05-14 16:37:32 +0000 | [diff] [blame] | 50 | ; CHECK-LABEL: GCC_except_table0: |
| 51 | ; CHECK-LABEL: .Lexception0: |
| 52 | ; CHECK: .byte 255 @ @LPStart Encoding = omit |
| 53 | ; CHECK: .byte 0 @ @TType Encoding = absptr |
| 54 | ; CHECK: .asciz |
| 55 | ; CHECK: .byte 3 @ Call site Encoding = udata4 |
| 56 | ; CHECK: .long |
| 57 | ; CHECK: .long |
| 58 | ; CHECK: .long |
| 59 | ; CHECK: .fnend |