blob: ecb23c3424e2d714f2416f5bf0bfa5d0d9c22a89 [file] [log] [blame]
Logan Chienba1b6952014-05-14 16:37:32 +00001; 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
18declare void @throw_exception()
19
20declare i32 @__gxx_personality_v0(...)
21
22declare i8* @__cxa_begin_catch(i8*)
23
24declare void @__cxa_end_catch()
25
David Majnemer7fddecc2015-06-17 20:52:32 +000026define void @test1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
Logan Chienba1b6952014-05-14 16:37:32 +000027entry:
28 invoke void @throw_exception() to label %try.cont unwind label %lpad
29
30lpad:
David Majnemer7fddecc2015-06-17 20:52:32 +000031 %0 = landingpad { i8*, i32 }
Logan Chienba1b6952014-05-14 16:37:32 +000032 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
38try.cont:
39 ret void
40}
41
42; CHECK: .globl test1
Dan Gohman61d15ae2016-01-26 00:03:25 +000043; CHECK: .p2align 2
Logan Chienba1b6952014-05-14 16:37:32 +000044; CHECK: .type test1,%function
45; CHECK-LABEL: test1:
46; CHECK: .fnstart
47; CHECK: .personality __gxx_personality_v0
48; CHECK: .handlerdata
Dan Gohman61d15ae2016-01-26 00:03:25 +000049; CHECK: .p2align 2
Logan Chienba1b6952014-05-14 16:37:32 +000050; 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