Skip to content

Commit bb5d9ac

Browse files
committed
More test case for r208715.
The commit r208166 will cause some regression on ARM EHABI. This fix has been committed in r208715, and an assertion failure test case has been committed in r208770. This commit further extends the unittest so that the actual value in the handlerdata will be checked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208790 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 202be06 commit bb5d9ac

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

test/CodeGen/ARM/ehabi-handlerdata.ll

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
26+
define void @test1() {
27+
entry:
28+
invoke void @throw_exception() to label %try.cont unwind label %lpad
29+
30+
lpad:
31+
%0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
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
43+
; CHECK: .align 2
44+
; CHECK: .type test1,%function
45+
; CHECK-LABEL: test1:
46+
; CHECK: .fnstart
47+
; CHECK: .personality __gxx_personality_v0
48+
; CHECK: .handlerdata
49+
; CHECK: .align 2
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

0 commit comments

Comments
 (0)